playbook_ui 16.12.0 → 16.13.0.pre.rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_map/docs/_playground.json +7 -0
- data/app/pb_kits/playbook/pb_map/docs/_playground.overrides.json +5 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +9 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.overrides.json +6 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +9 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.overrides.json +6 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +9 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.overrides.json +6 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +9 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.overrides.json +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +11 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +11 -0
- data/app/pb_kits/playbook/utilities/_grid.scss +2 -0
- data/app/pb_kits/playbook/utilities/global-props.schema.json +97 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +89 -1
- data/app/pb_kits/playbook/utilities/grid_global_props/_grid_auto_flow.scss +9 -0
- data/app/pb_kits/playbook/utilities/grid_global_props/_justify_items.scss +8 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/grid.test.js +72 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/gridAutoFlow.test.js +41 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyItems.test.js +41 -0
- data/dist/chunks/{_pb_line_graph-xWHipZZB.js → _pb_line_graph-BL9pXDkX.js} +1 -1
- data/dist/chunks/_typeahead-BrQbahtd.js +5 -0
- data/dist/chunks/{globalProps-Bf9KbYid.js → globalProps-BQqb1ZGy.js} +2 -2
- data/dist/chunks/{lib-DYWDQgCv.js → lib-CYrXqTdQ.js} +2 -2
- data/dist/chunks/vendor.js +3 -3
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +4 -0
- data/lib/playbook/grid.rb +29 -0
- data/lib/playbook/grid_auto_flow.rb +36 -0
- data/lib/playbook/justify_items.rb +36 -0
- data/lib/playbook/kit_base.rb +26 -1
- data/lib/playbook/version.rb +2 -2
- metadata +15 -6
- data/dist/chunks/_typeahead-6Dx7GOMe.js +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f88b832ff7611e88af8ad226ab93b3a482b433e054224ebc50e160b0408b4507
|
|
4
|
+
data.tar.gz: 3823106c98aee4b2f75df5a55b323e4f0053f3601bbe89c26de6a9b8805abee3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61f636f888ecc07287dbbd756660c9ee48c699ff058359360ff943fca29b84ece948acb08fccbd460f8592958358eb191480ce1539a1f979a37094f52ddd7252
|
|
7
|
+
data.tar.gz: 2ecfc8e99e535d7eba067ad09bcb30cdac8c3be243e4ee8f3a94be3a00bec5d042f3d256c31894da51e70c3a3359a70c317b48dd77e90f5ca3ce2ac40c69381f
|
|
@@ -116,6 +116,13 @@
|
|
|
116
116
|
"type": "info"
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
+
"externalDependencies": {
|
|
120
|
+
"packages": [
|
|
121
|
+
"maplibre-gl"
|
|
122
|
+
],
|
|
123
|
+
"optional": true,
|
|
124
|
+
"note": "Map wraps MapLibre. The host app must already have maplibre-gl (and any required CSS) installed. Agents must not install packages — tell the user if they are missing."
|
|
125
|
+
},
|
|
119
126
|
"structureModes": {
|
|
120
127
|
"default": "maplibre",
|
|
121
128
|
"modes": {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": ["maplibre-gl"],
|
|
4
|
+
"optional": true,
|
|
5
|
+
"note": "Map wraps MapLibre. The host app must already have maplibre-gl (and any required CSS) installed. Agents must not install packages — tell the user if they are missing."
|
|
6
|
+
},
|
|
2
7
|
"structureModes": {
|
|
3
8
|
"default": "maplibre",
|
|
4
9
|
"modes": {
|
|
@@ -389,6 +389,15 @@
|
|
|
389
389
|
"type": "info"
|
|
390
390
|
}
|
|
391
391
|
},
|
|
392
|
+
"externalDependencies": {
|
|
393
|
+
"packages": [
|
|
394
|
+
"highcharts",
|
|
395
|
+
"highcharts-react-official"
|
|
396
|
+
],
|
|
397
|
+
"optional": true,
|
|
398
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
399
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
400
|
+
},
|
|
392
401
|
"externalImports": [
|
|
393
402
|
"import { PbBarGraph } from 'playbook-ui/charts'"
|
|
394
403
|
]
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": ["highcharts", "highcharts-react-official"],
|
|
4
|
+
"optional": true,
|
|
5
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
6
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
7
|
+
},
|
|
2
8
|
"template": "<PbBarGraph{{props}} />",
|
|
3
9
|
"externalImports": [
|
|
4
10
|
"import { PbBarGraph } from 'playbook-ui/charts'"
|
|
@@ -226,6 +226,15 @@
|
|
|
226
226
|
"type": "info"
|
|
227
227
|
}
|
|
228
228
|
},
|
|
229
|
+
"externalDependencies": {
|
|
230
|
+
"packages": [
|
|
231
|
+
"highcharts",
|
|
232
|
+
"highcharts-react-official"
|
|
233
|
+
],
|
|
234
|
+
"optional": true,
|
|
235
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
236
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
237
|
+
},
|
|
229
238
|
"externalImports": [
|
|
230
239
|
"import { PbCircleChart } from 'playbook-ui/charts'"
|
|
231
240
|
]
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": ["highcharts", "highcharts-react-official"],
|
|
4
|
+
"optional": true,
|
|
5
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
6
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
7
|
+
},
|
|
2
8
|
"template": "<PbCircleChart{{props}} />",
|
|
3
9
|
"externalImports": [
|
|
4
10
|
"import { PbCircleChart } from 'playbook-ui/charts'"
|
|
@@ -160,6 +160,15 @@
|
|
|
160
160
|
"type": "info"
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
+
"externalDependencies": {
|
|
164
|
+
"packages": [
|
|
165
|
+
"highcharts",
|
|
166
|
+
"highcharts-react-official"
|
|
167
|
+
],
|
|
168
|
+
"optional": true,
|
|
169
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
170
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
171
|
+
},
|
|
163
172
|
"externalImports": [
|
|
164
173
|
"import { PbGaugeChart } from 'playbook-ui/charts'"
|
|
165
174
|
]
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": ["highcharts", "highcharts-react-official"],
|
|
4
|
+
"optional": true,
|
|
5
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
6
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
7
|
+
},
|
|
2
8
|
"template": "<PbGaugeChart{{props}} />",
|
|
3
9
|
"externalImports": [
|
|
4
10
|
"import { PbGaugeChart } from 'playbook-ui/charts'"
|
|
@@ -403,6 +403,15 @@
|
|
|
403
403
|
"type": "info"
|
|
404
404
|
}
|
|
405
405
|
},
|
|
406
|
+
"externalDependencies": {
|
|
407
|
+
"packages": [
|
|
408
|
+
"highcharts",
|
|
409
|
+
"highcharts-react-official"
|
|
410
|
+
],
|
|
411
|
+
"optional": true,
|
|
412
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
413
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
414
|
+
},
|
|
406
415
|
"externalImports": [
|
|
407
416
|
"import { PbLineGraph } from 'playbook-ui/charts'"
|
|
408
417
|
]
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": ["highcharts", "highcharts-react-official"],
|
|
4
|
+
"optional": true,
|
|
5
|
+
"note": "This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.",
|
|
6
|
+
"docs": "https://api.highcharts.com/highcharts/"
|
|
7
|
+
},
|
|
2
8
|
"template": "<PbLineGraph{{props}} />",
|
|
3
9
|
"externalImports": [
|
|
4
10
|
"import { PbLineGraph } from 'playbook-ui/charts'"
|
|
@@ -127,6 +127,17 @@
|
|
|
127
127
|
"type": "info"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
+
"externalDependencies": {
|
|
131
|
+
"packages": [
|
|
132
|
+
"react-trix",
|
|
133
|
+
"trix",
|
|
134
|
+
"@tiptap/react",
|
|
135
|
+
"@tiptap/starter-kit",
|
|
136
|
+
"@tiptap/extension-link"
|
|
137
|
+
],
|
|
138
|
+
"optional": true,
|
|
139
|
+
"note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced editor uses TipTap. The host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails advanced TipTap may load via the kit’s esm.sh script."
|
|
140
|
+
},
|
|
130
141
|
"structureModes": {
|
|
131
142
|
"default": "advanced",
|
|
132
143
|
"modes": {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
+
"externalDependencies": {
|
|
3
|
+
"packages": [
|
|
4
|
+
"react-trix",
|
|
5
|
+
"trix",
|
|
6
|
+
"@tiptap/react",
|
|
7
|
+
"@tiptap/starter-kit",
|
|
8
|
+
"@tiptap/extension-link"
|
|
9
|
+
],
|
|
10
|
+
"optional": true,
|
|
11
|
+
"note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced editor uses TipTap. The host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails advanced TipTap may load via the kit’s esm.sh script."
|
|
12
|
+
},
|
|
2
13
|
"structureModes": {
|
|
3
14
|
"default": "advanced",
|
|
4
15
|
"modes": {
|
|
@@ -395,6 +395,103 @@
|
|
|
395
395
|
"description": "Justify self.",
|
|
396
396
|
"example": "justifySelf=\"start\" or justifySelf={{ default: \"start\", md: \"end\" }}"
|
|
397
397
|
},
|
|
398
|
+
"justifyItems": {
|
|
399
|
+
"type": "enum | responsive",
|
|
400
|
+
"platforms": [
|
|
401
|
+
"react",
|
|
402
|
+
"rails"
|
|
403
|
+
],
|
|
404
|
+
"values": [
|
|
405
|
+
"start",
|
|
406
|
+
"end",
|
|
407
|
+
"center",
|
|
408
|
+
"stretch"
|
|
409
|
+
],
|
|
410
|
+
"responsive": true,
|
|
411
|
+
"description": "Justify items.",
|
|
412
|
+
"example": "justifyItems=\"start\" or justifyItems={{ default: \"start\", md: \"end\" }}"
|
|
413
|
+
},
|
|
414
|
+
"gridTemplateColumns": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"platforms": [
|
|
417
|
+
"react",
|
|
418
|
+
"rails"
|
|
419
|
+
],
|
|
420
|
+
"description": "Grid template columns."
|
|
421
|
+
},
|
|
422
|
+
"gridTemplateRows": {
|
|
423
|
+
"type": "string",
|
|
424
|
+
"platforms": [
|
|
425
|
+
"react",
|
|
426
|
+
"rails"
|
|
427
|
+
],
|
|
428
|
+
"description": "Grid template rows."
|
|
429
|
+
},
|
|
430
|
+
"gridTemplateAreas": {
|
|
431
|
+
"type": "string",
|
|
432
|
+
"platforms": [
|
|
433
|
+
"react",
|
|
434
|
+
"rails"
|
|
435
|
+
],
|
|
436
|
+
"description": "Grid template areas."
|
|
437
|
+
},
|
|
438
|
+
"gridColumn": {
|
|
439
|
+
"type": "string",
|
|
440
|
+
"platforms": [
|
|
441
|
+
"react",
|
|
442
|
+
"rails"
|
|
443
|
+
],
|
|
444
|
+
"description": "Grid column."
|
|
445
|
+
},
|
|
446
|
+
"gridRow": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"platforms": [
|
|
449
|
+
"react",
|
|
450
|
+
"rails"
|
|
451
|
+
],
|
|
452
|
+
"description": "Grid row."
|
|
453
|
+
},
|
|
454
|
+
"gridArea": {
|
|
455
|
+
"type": "string",
|
|
456
|
+
"platforms": [
|
|
457
|
+
"react",
|
|
458
|
+
"rails"
|
|
459
|
+
],
|
|
460
|
+
"description": "Grid area."
|
|
461
|
+
},
|
|
462
|
+
"gridAutoColumns": {
|
|
463
|
+
"type": "string",
|
|
464
|
+
"platforms": [
|
|
465
|
+
"react",
|
|
466
|
+
"rails"
|
|
467
|
+
],
|
|
468
|
+
"description": "Grid auto columns."
|
|
469
|
+
},
|
|
470
|
+
"gridAutoRows": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"platforms": [
|
|
473
|
+
"react",
|
|
474
|
+
"rails"
|
|
475
|
+
],
|
|
476
|
+
"description": "Grid auto rows."
|
|
477
|
+
},
|
|
478
|
+
"gridAutoFlow": {
|
|
479
|
+
"type": "enum | responsive",
|
|
480
|
+
"platforms": [
|
|
481
|
+
"react",
|
|
482
|
+
"rails"
|
|
483
|
+
],
|
|
484
|
+
"values": [
|
|
485
|
+
"row",
|
|
486
|
+
"column",
|
|
487
|
+
"dense",
|
|
488
|
+
"rowDense",
|
|
489
|
+
"columnDense"
|
|
490
|
+
],
|
|
491
|
+
"responsive": true,
|
|
492
|
+
"description": "Grid auto flow.",
|
|
493
|
+
"example": "gridAutoFlow=\"row\" or gridAutoFlow={{ default: \"row\", md: \"column\" }}"
|
|
494
|
+
},
|
|
398
495
|
"lineHeight": {
|
|
399
496
|
"type": "enum",
|
|
400
497
|
"platforms": [
|
|
@@ -139,6 +139,46 @@ type RowGap = {
|
|
|
139
139
|
rowGap?: string,
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
type GridTemplateColumns = {
|
|
143
|
+
gridTemplateColumns?: string,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type GridTemplateRows = {
|
|
147
|
+
gridTemplateRows?: string,
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
type GridTemplateAreas = {
|
|
151
|
+
gridTemplateAreas?: string,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
type GridColumn = {
|
|
155
|
+
gridColumn?: string,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
type GridRow = {
|
|
159
|
+
gridRow?: string,
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type GridArea = {
|
|
163
|
+
gridArea?: string,
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type GridAutoColumns = {
|
|
167
|
+
gridAutoColumns?: string,
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
type GridAutoRows = {
|
|
171
|
+
gridAutoRows?: string,
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type GridAutoFlow = {
|
|
175
|
+
gridAutoFlow?: "row" | "column" | "dense" | "rowDense" | "columnDense"
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
type JustifyItems = {
|
|
179
|
+
justifyItems?: Alignment | "stretch"
|
|
180
|
+
}
|
|
181
|
+
|
|
142
182
|
type NumberSpacing = {
|
|
143
183
|
numberSpacing?: "tabular",
|
|
144
184
|
}
|
|
@@ -226,7 +266,9 @@ type MinHeight = {
|
|
|
226
266
|
// keep this as the last type definition
|
|
227
267
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
|
228
268
|
BorderProp & BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
|
229
|
-
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
|
269
|
+
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf & JustifyItems &
|
|
270
|
+
GridTemplateColumns & GridTemplateRows & GridTemplateAreas & GridColumn & GridRow & GridArea &
|
|
271
|
+
GridAutoColumns & GridAutoRows & GridAutoFlow &
|
|
230
272
|
LineHeight & Margin & Width & MinWidth & MaxWidth & Gap & ColumnGap & RowGap & NumberSpacing & Order & Overflow & Padding &
|
|
231
273
|
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
|
|
232
274
|
|
|
@@ -644,6 +686,20 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
|
644
686
|
return justifySelf ? `justify_self_${justifySelf}` : ''
|
|
645
687
|
}
|
|
646
688
|
},
|
|
689
|
+
justifyItemsProps: ({ justifyItems }: JustifyItems) => {
|
|
690
|
+
if (typeof justifyItems === 'object') {
|
|
691
|
+
return getResponsivePropClasses(justifyItems, 'justify_items')
|
|
692
|
+
} else {
|
|
693
|
+
return justifyItems ? `justify_items_${camelToSnakeCase(justifyItems)}` : ''
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
gridAutoFlowProps: ({ gridAutoFlow }: GridAutoFlow) => {
|
|
697
|
+
if (typeof gridAutoFlow === 'object') {
|
|
698
|
+
return getResponsivePropClasses(gridAutoFlow, 'grid_auto_flow')
|
|
699
|
+
} else {
|
|
700
|
+
return gridAutoFlow ? `grid_auto_flow_${camelToSnakeCase(gridAutoFlow)}` : ''
|
|
701
|
+
}
|
|
702
|
+
},
|
|
647
703
|
orderProps: ({ order }: Order) => {
|
|
648
704
|
if (typeof order === 'object') {
|
|
649
705
|
return getResponsivePropClasses(order, 'flex_order')
|
|
@@ -696,6 +752,38 @@ const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[
|
|
|
696
752
|
minHeightProps: ({ minHeight }: MinHeight) => {
|
|
697
753
|
return minHeight ? { minHeight } : {};
|
|
698
754
|
},
|
|
755
|
+
|
|
756
|
+
gridTemplateColumnsProps: ({ gridTemplateColumns }: GridTemplateColumns) => {
|
|
757
|
+
return gridTemplateColumns ? { gridTemplateColumns } : {};
|
|
758
|
+
},
|
|
759
|
+
|
|
760
|
+
gridTemplateRowsProps: ({ gridTemplateRows }: GridTemplateRows) => {
|
|
761
|
+
return gridTemplateRows ? { gridTemplateRows } : {};
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
gridTemplateAreasProps: ({ gridTemplateAreas }: GridTemplateAreas) => {
|
|
765
|
+
return gridTemplateAreas ? { gridTemplateAreas } : {};
|
|
766
|
+
},
|
|
767
|
+
|
|
768
|
+
gridColumnProps: ({ gridColumn }: GridColumn) => {
|
|
769
|
+
return gridColumn ? { gridColumn } : {};
|
|
770
|
+
},
|
|
771
|
+
|
|
772
|
+
gridRowProps: ({ gridRow }: GridRow) => {
|
|
773
|
+
return gridRow ? { gridRow } : {};
|
|
774
|
+
},
|
|
775
|
+
|
|
776
|
+
gridAreaProps: ({ gridArea }: GridArea) => {
|
|
777
|
+
return gridArea ? { gridArea } : {};
|
|
778
|
+
},
|
|
779
|
+
|
|
780
|
+
gridAutoColumnsProps: ({ gridAutoColumns }: GridAutoColumns) => {
|
|
781
|
+
return gridAutoColumns ? { gridAutoColumns } : {};
|
|
782
|
+
},
|
|
783
|
+
|
|
784
|
+
gridAutoRowsProps: ({ gridAutoRows }: GridAutoRows) => {
|
|
785
|
+
return gridAutoRows ? { gridAutoRows } : {};
|
|
786
|
+
},
|
|
699
787
|
}
|
|
700
788
|
|
|
701
789
|
type DefaultProps = {[key: string]: string} | Record<string, unknown>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { render, screen } from '../../test-utils'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import Card from '../../../pb_card/_card'
|
|
4
|
+
|
|
5
|
+
test('Global Props: gridTemplateColumns applies inline style on Card', () => {
|
|
6
|
+
render(
|
|
7
|
+
<Card
|
|
8
|
+
data={{ testid: 'grid-template-columns' }}
|
|
9
|
+
display="grid"
|
|
10
|
+
gridTemplateColumns="repeat(3, 1fr)"
|
|
11
|
+
>
|
|
12
|
+
Test
|
|
13
|
+
</Card>
|
|
14
|
+
)
|
|
15
|
+
expect(screen.getByTestId('grid-template-columns')).toHaveStyle({
|
|
16
|
+
gridTemplateColumns: 'repeat(3, 1fr)',
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('Global Props: gridTemplateRows applies inline style on Card', () => {
|
|
21
|
+
render(
|
|
22
|
+
<Card
|
|
23
|
+
data={{ testid: 'grid-template-rows' }}
|
|
24
|
+
display="grid"
|
|
25
|
+
gridTemplateRows="59px 341px"
|
|
26
|
+
>
|
|
27
|
+
Test
|
|
28
|
+
</Card>
|
|
29
|
+
)
|
|
30
|
+
expect(screen.getByTestId('grid-template-rows')).toHaveStyle({
|
|
31
|
+
gridTemplateRows: '59px 341px',
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
test('Global Props: grid placement props apply inline styles on Card', () => {
|
|
36
|
+
render(
|
|
37
|
+
<Card
|
|
38
|
+
data={{ testid: 'grid-placement' }}
|
|
39
|
+
gridArea="header"
|
|
40
|
+
gridColumn="1 / 3"
|
|
41
|
+
gridRow="2"
|
|
42
|
+
>
|
|
43
|
+
Test
|
|
44
|
+
</Card>
|
|
45
|
+
)
|
|
46
|
+
const kit = screen.getByTestId('grid-placement')
|
|
47
|
+
expect(kit).toHaveStyle({
|
|
48
|
+
gridColumn: '1 / 3',
|
|
49
|
+
gridRow: '2',
|
|
50
|
+
gridArea: 'header',
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test('Global Props: grid auto track sizes apply inline styles on Card', () => {
|
|
55
|
+
render(
|
|
56
|
+
<Card
|
|
57
|
+
data={{ testid: 'grid-auto-tracks' }}
|
|
58
|
+
display="grid"
|
|
59
|
+
gridAutoColumns="minmax(100px, 1fr)"
|
|
60
|
+
gridAutoRows="auto"
|
|
61
|
+
gridTemplateAreas="'header header' 'sidebar main'"
|
|
62
|
+
>
|
|
63
|
+
Test
|
|
64
|
+
</Card>
|
|
65
|
+
)
|
|
66
|
+
const kit = screen.getByTestId('grid-auto-tracks')
|
|
67
|
+
expect(kit).toHaveStyle({
|
|
68
|
+
gridAutoColumns: 'minmax(100px, 1fr)',
|
|
69
|
+
gridAutoRows: 'auto',
|
|
70
|
+
gridTemplateAreas: "'header header' 'sidebar main'",
|
|
71
|
+
})
|
|
72
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import { camelToSnakeCase } from '../../../utilities/text'
|
|
3
|
+
import Body from '../../../pb_body/_body'
|
|
4
|
+
import Button from '../../../pb_button/_button'
|
|
5
|
+
import Card from '../../../pb_card/_card'
|
|
6
|
+
import Title from '../../../pb_title/_title'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
10
|
+
|
|
11
|
+
const kits = [Body, Button, Card, Title, Flex, Link, Badge]
|
|
12
|
+
|
|
13
|
+
testGlobalProp(
|
|
14
|
+
'gridAutoFlow',
|
|
15
|
+
['row', 'column', 'dense', 'rowDense', 'columnDense'],
|
|
16
|
+
(v) => `grid_auto_flow_${camelToSnakeCase(v)}`,
|
|
17
|
+
(size, v) => `grid_auto_flow_${size}_${camelToSnakeCase(v)}`,
|
|
18
|
+
kits
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
testGlobalPropResponsiveWithDefault(
|
|
22
|
+
'gridAutoFlow',
|
|
23
|
+
{ default: 'row', xs: 'column', sm: 'dense', md: 'rowDense' },
|
|
24
|
+
(v) => `grid_auto_flow_${camelToSnakeCase(v)}`,
|
|
25
|
+
(size, v) => `grid_auto_flow_${size}_${camelToSnakeCase(v)}`
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
testGlobalPropAbsence(
|
|
29
|
+
'gridAutoFlow',
|
|
30
|
+
['grid_auto_flow_row', 'grid_auto_flow_column', 'grid_auto_flow_dense', 'grid_auto_flow_row_dense', 'grid_auto_flow_column_dense'],
|
|
31
|
+
undefined,
|
|
32
|
+
{ skipNull: true }
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
testGlobalPropInvalidValues(
|
|
36
|
+
'gridAutoFlow',
|
|
37
|
+
['invalid', 'bad_value', 'not_a_flow_value', 'special-chars!@#'],
|
|
38
|
+
['grid_auto_flow_invalid', 'grid_auto_flow_bad_value', 'grid_auto_flow_not_a_flow_value', 'grid_auto_flow_special-chars!@#'],
|
|
39
|
+
undefined,
|
|
40
|
+
{ skipKnownIssues: true, allowRenderingErrors: true }
|
|
41
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import { camelToSnakeCase } from '../../../utilities/text'
|
|
3
|
+
import Body from '../../../pb_body/_body'
|
|
4
|
+
import Button from '../../../pb_button/_button'
|
|
5
|
+
import Card from '../../../pb_card/_card'
|
|
6
|
+
import Title from '../../../pb_title/_title'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
10
|
+
|
|
11
|
+
const kits = [Body, Button, Card, Title, Flex, Link, Badge]
|
|
12
|
+
|
|
13
|
+
testGlobalProp(
|
|
14
|
+
'justifyItems',
|
|
15
|
+
['start', 'center', 'end', 'stretch'],
|
|
16
|
+
(v) => `justify_items_${camelToSnakeCase(v)}`,
|
|
17
|
+
(size, v) => `justify_items_${size}_${camelToSnakeCase(v)}`,
|
|
18
|
+
kits
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
testGlobalPropResponsiveWithDefault(
|
|
22
|
+
'justifyItems',
|
|
23
|
+
{ default: 'start', xs: 'center', sm: 'end', md: 'stretch' },
|
|
24
|
+
(v) => `justify_items_${camelToSnakeCase(v)}`,
|
|
25
|
+
(size, v) => `justify_items_${size}_${camelToSnakeCase(v)}`
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
testGlobalPropAbsence(
|
|
29
|
+
'justifyItems',
|
|
30
|
+
['justify_items_start', 'justify_items_center', 'justify_items_end', 'justify_items_stretch'],
|
|
31
|
+
undefined,
|
|
32
|
+
{ skipNull: true }
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
testGlobalPropInvalidValues(
|
|
36
|
+
'justifyItems',
|
|
37
|
+
['invalid', 'bad_value', 'not_a_justify_value', 'special-chars!@#'],
|
|
38
|
+
['justify_items_invalid', 'justify_items_bad_value', 'justify_items_not_a_justify_value', 'justify_items_special-chars!@#'],
|
|
39
|
+
undefined,
|
|
40
|
+
{ skipKnownIssues: true, allowRenderingErrors: true }
|
|
41
|
+
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx}from"react/jsx-runtime";import{useMemo}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,e as buildCss,g as globalProps}from"./globalProps-
|
|
1
|
+
import{jsx}from"react/jsx-runtime";import{useMemo}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,e as buildCss,g as globalProps}from"./globalProps-BQqb1ZGy.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-CYrXqTdQ.js";import highchartsMore from"highcharts/highcharts-more";import solidGauge from"highcharts/modules/solid-gauge";const barGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"column"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],credits:{enabled:false},legend:{enabled:false,itemStyle:{color:colors.text_lt_light,fill:colors.text_lt_light,fontSize:typography.text_smaller}},xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbBarGraph=props=>{const{aria:aria={},data:data={},id:id,htmlOptions:htmlOptions={},options:options,className:className}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_bar_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbBarGraph />",options);return{}}return Highcharts.merge({},barGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbCircleChartTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},chart:{type:"pie"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{pie:{dataLabels:{enabled:false,connectorShape:"straight",connectorWidth:3,format:"<div>{point.name}</div>",style:{fontFamily:typography.font_family_base,fontSize:typography.text_smaller,color:colors.text_lt_light,fontWeight:typography.regular,textOutline:"2px $white"}},innerSize:"50%",borderColor:"",borderWidth:null,colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7]}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},credits:{enabled:false}};const PbCircleChart=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_circle_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbCircleChart />",options);return{}}return Highcharts.merge({},pbCircleChartTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbGaugeGraphTheme={title:{text:"",style:{fontFamily:typography.font_family_base,fontSize:typography.text_larger}},chart:{type:"solidgauge",events:{render(){this.container;const arc=this.container.querySelector("path.gauge-pane");if(arc)arc.setAttribute("stroke-linejoin","round")}}},pane:{size:"90%",startAngle:-100,endAngle:100,background:[{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane",borderColor:colors.border_light,borderRadius:"50%"}]},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{borderColor:colors.data_1,borderWidth:20,color:colors.data_1,radius:90,innerRadius:"90%",y:-26,dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:'<span class="fix">{y:,f}</span>',style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}},credits:{enabled:false}};const PbGaugeChart=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,ref:ref,options:options={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_gauge_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbGaugeGraphTheme,options)}),[options]);highchartsMore(Highcharts);solidGauge(Highcharts);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,ref:ref,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbLineGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"line"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{line:{dataLabels:{enabled:false}}},credits:{enabled:false},legend:{enabled:false,itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,tickPixelInterval:50,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbLineGraph=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_line_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbLineGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};export{PbBarGraph as P,PbCircleChart as a,PbGaugeChart as b,PbLineGraph as c};
|