Skip to content

Commit 6be4763

Browse files
committed
Fix p component, extract :children arg-desc
1 parent dab68ff commit 6be4763

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

src/re_com/args.cljs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
(:require
33
[re-com.validate :refer [css-style? html-attr? parts? vector-of-maps? css-class?]]))
44

5+
(def children
6+
{:description "Pass a list of hiccups for this component to use, or contain."
7+
:name :children
8+
:required true
9+
:type "vector of hiccups | list of hiccups"
10+
:validate-fn sequential?})
11+
512
(def class
613
{:name :class,
714
:required false,

src/re_com/box.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226

227227
(def h-box-args-desc
228228
(when include-args-desc?
229-
[{:name :children :required true :type "vector" :validate-fn sequential? :description "a vector (or list) of components"}
229+
[args/children
230230
{:name :size :required false :default "none" :type "string" :validate-fn string? :description [:span "equivalent to CSS style " [:span.bold "flex"] "." [:br] "Examples: " [:code "initial"] ", " [:code "auto"] ", " [:code "none"] ", " [:code "100px"] ", " [:code "2"] " or a generic triple of " [:code "grow shrink basis"]]}
231231
{:name :width :required false :type "string" :validate-fn string? :description "a CSS width style"}
232232
{:name :height :required false :type "string" :validate-fn string? :description "a CSS height style"}
@@ -291,7 +291,7 @@
291291

292292
(def v-box-args-desc
293293
(when include-args-desc?
294-
[{:name :children :required true :type "vector" :validate-fn sequential? :description "a vector (or list) of components"}
294+
[args/children
295295
{:name :size :required false :default "none" :type "string" :validate-fn string? :description [:span "equivalent to CSS style " [:span.bold "flex"] "." [:br] "Examples: " [:code "initial"] ", " [:code "auto"] ", " [:code "none"] ", " [:code "100px"] ", " [:code "2"] " or a generic triple of " [:code "grow shrink basis"]]}
296296
{:name :width :required false :type "string" :validate-fn string? :description "a CSS width style"}
297297
{:name :height :required false :type "string" :validate-fn string? :description "a CSS height style"}

src/re_com/nested_grid.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[re-com.validate :refer [validate-args-macro]])
44
(:require
55
[clojure.string :as str]
6+
[re-com.args :as args]
67
[re-com.config :as config :refer [include-args-desc?]]
78
[re-com.validate]
89
[re-com.util :as u]
@@ -18,7 +19,7 @@
1819
[{:name :row-path}
1920
{:name :column-path}
2021
{:name :value}
21-
{:name :children}])
22+
args/children])
2223

2324
(def part-structure
2425
[::wrapper

src/re_com/popover.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[re-com.core :refer [handler-fn at reflect-current-component]]
44
[re-com.validate :refer [validate-args-macro]])
55
(:require
6+
[re-com.args :as args]
67
[re-com.config :refer [include-args-desc?]]
78
[re-com.debug :refer [->attr]]
89
[re-com.theme :as theme]
@@ -272,7 +273,7 @@
272273

273274
(def popover-border-args-desc
274275
(when include-args-desc?
275-
[{:name :children :required true :type "vector" :validate-fn sequential? :description "a vector of component markups"}
276+
[args/children
276277
{:name :position :required true :type "keyword r/atom" :validate-fn position? :description [:span "relative to this anchor. One of " position-options-list]}
277278
{:name :optimize-position? :required false :type "boolean" :default "true" :description "When true, dynamically repositions the popover body to fit within the available viewport space."}
278279
{:name :position-offset :required false :type "integer" :validate-fn number? :description [:span "px offset of the arrow from its default " [:code ":position"] " along the popover border. Is ignored when " [:code ":position"] " is one of the " [:code ":xxx-center"] " variants. Positive numbers slide the popover toward its center"]}

src/re_com/text.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@
172172
(def p-args-desc
173173
(when include-args-desc?
174174
(into
175-
[args/class
175+
[(merge args/children {:required false})
176+
args/class
176177
args/style
177178
args/attr
178179
(args/parts p-parts)

0 commit comments

Comments
 (0)