@chobantonov/jsonforms-react-shadcn-renderers 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +157 -2
- package/lib/additional/LabelRenderer.d.ts +4 -0
- package/lib/additional/index.d.ts +1 -0
- package/lib/cells/BooleanCell.d.ts +3 -0
- package/lib/cells/Cell.d.ts +3 -0
- package/lib/cells/CompositeCell.d.ts +9 -0
- package/lib/cells/CompositeDetailDialog.d.ts +3 -0
- package/lib/cells/EnumCell.d.ts +3 -0
- package/lib/cells/NumberCell.d.ts +3 -0
- package/lib/cells/NumberFormatCell.d.ts +4 -0
- package/lib/cells/TextCell.d.ts +3 -0
- package/lib/cells/asCell.d.ts +12 -0
- package/lib/cells/index.d.ts +7 -0
- package/lib/complex/AdditionalProperties.d.ts +4 -0
- package/lib/complex/AnyOfRenderer.d.ts +7 -0
- package/lib/complex/ArrayChoicesControl.d.ts +6 -0
- package/lib/complex/ArrayControlRenderer.d.ts +4 -0
- package/lib/complex/ArrayPanelToggle.d.ts +6 -0
- package/lib/complex/CollectionPager.d.ts +5 -0
- package/lib/complex/CombinatorSwitchDialog.d.ts +8 -0
- package/lib/complex/DeleteDialog.d.ts +6 -0
- package/lib/complex/DetailDialogContent.d.ts +7 -0
- package/lib/complex/ErrorIndicator.d.ts +7 -0
- package/lib/complex/MixedRenderer.d.ts +6 -0
- package/lib/complex/ObjectRenderer.d.ts +3 -0
- package/lib/complex/OneOfRenderer.d.ts +5 -0
- package/lib/complex/RecursiveTreeRenderer.d.ts +4 -0
- package/lib/complex/RowDetailFrame.d.ts +16 -0
- package/lib/complex/ScalarCompositionRenderer.d.ts +4 -0
- package/lib/complex/TupleAdditionalItems.d.ts +4 -0
- package/lib/complex/TupleControlRenderer.d.ts +6 -0
- package/lib/complex/TupleField.d.ts +4 -0
- package/lib/complex/array/ArrayItemPanels.d.ts +18 -0
- package/lib/complex/array/ArrayItemViewProps.d.ts +11 -0
- package/lib/complex/array/ArrayListDetail.d.ts +9 -0
- package/lib/complex/array/ArrayTable.d.ts +21 -0
- package/lib/complex/index.d.ts +10 -0
- package/lib/complex/mixed/JsonTypeIcon.d.ts +5 -0
- package/lib/complex/mixed/MixedWidgets.d.ts +22 -0
- package/lib/complex/mixed/useConfirmation.d.ts +6 -0
- package/lib/components/ClearValueButton.d.ts +12 -0
- package/lib/components/ScrollRegion.d.ts +4 -0
- package/lib/components/TimePicker.d.ts +13 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/controls/AnyOfStringOrEnumControl.d.ts +4 -0
- package/lib/controls/BooleanControl.d.ts +4 -0
- package/lib/controls/BooleanToggleControl.d.ts +4 -0
- package/lib/controls/ChoiceCards.d.ts +1 -0
- package/lib/controls/DateControl.d.ts +4 -0
- package/lib/controls/DateTimeControl.d.ts +4 -0
- package/lib/controls/EnumControl.d.ts +5 -0
- package/lib/controls/InputControl.d.ts +30 -0
- package/lib/controls/IntegerControl.d.ts +4 -0
- package/lib/controls/NumberControl.d.ts +4 -0
- package/lib/controls/OneOfEnumControl.d.ts +3 -0
- package/lib/controls/PasswordControl.d.ts +9 -0
- package/lib/controls/RadioGroupControl.d.ts +4 -0
- package/lib/controls/SliderControl.d.ts +4 -0
- package/lib/controls/TextControl.d.ts +4 -0
- package/lib/controls/TimeControl.d.ts +4 -0
- package/lib/controls/index.d.ts +15 -0
- package/lib/index.d.ts +6 -0
- package/lib/jsonforms-react-shadcn.cjs.js +3 -0
- package/lib/jsonforms-react-shadcn.cjs.js.map +1 -0
- package/lib/jsonforms-react-shadcn.esm.js +4040 -0
- package/lib/jsonforms-react-shadcn.esm.js.map +1 -0
- package/lib/layouts/CategorizationLayout.d.ts +7 -0
- package/lib/layouts/GroupLayout.d.ts +4 -0
- package/lib/layouts/HorizontalLayout.d.ts +4 -0
- package/lib/layouts/Layout.d.ts +5 -0
- package/lib/layouts/ValidationIndicator.d.ts +4 -0
- package/lib/layouts/VerticalLayout.d.ts +4 -0
- package/lib/layouts/index.d.ts +4 -0
- package/lib/renderers.d.ts +8 -0
- package/lib/util/dateTime.d.ts +12 -0
- package/lib/util/groupState.d.ts +1 -0
- package/lib/util/useTemporalControl.d.ts +28 -0
- package/package.json +86 -3
- package/src/additional/LabelRenderer.tsx +8 -0
- package/src/additional/index.ts +1 -0
- package/src/cells/BooleanCell.tsx +26 -0
- package/src/cells/Cell.tsx +101 -0
- package/src/cells/CompositeCell.tsx +275 -0
- package/src/cells/CompositeDetailDialog.tsx +79 -0
- package/src/cells/EnumCell.tsx +74 -0
- package/src/cells/NumberCell.tsx +51 -0
- package/src/cells/NumberFormatCell.tsx +47 -0
- package/src/cells/TextCell.tsx +40 -0
- package/src/cells/asCell.tsx +79 -0
- package/src/cells/index.ts +7 -0
- package/src/complex/AdditionalProperties.tsx +453 -0
- package/src/complex/AnyOfRenderer.tsx +341 -0
- package/src/complex/ArrayChoicesControl.tsx +303 -0
- package/src/complex/ArrayControlRenderer.tsx +400 -0
- package/src/complex/ArrayPanelToggle.tsx +33 -0
- package/src/complex/CollectionPager.tsx +76 -0
- package/src/complex/CombinatorSwitchDialog.tsx +43 -0
- package/src/complex/DeleteDialog.tsx +41 -0
- package/src/complex/DetailDialogContent.tsx +84 -0
- package/src/complex/ErrorIndicator.tsx +136 -0
- package/src/complex/MixedRenderer.tsx +262 -0
- package/src/complex/ObjectRenderer.tsx +43 -0
- package/src/complex/OneOfRenderer.tsx +14 -0
- package/src/complex/RecursiveTreeRenderer.tsx +20 -0
- package/src/complex/RowDetailFrame.tsx +158 -0
- package/src/complex/ScalarCompositionRenderer.tsx +14 -0
- package/src/complex/TupleAdditionalItems.tsx +94 -0
- package/src/complex/TupleControlRenderer.tsx +54 -0
- package/src/complex/TupleField.tsx +41 -0
- package/src/complex/array/ArrayItemPanels.tsx +217 -0
- package/src/complex/array/ArrayItemViewProps.ts +15 -0
- package/src/complex/array/ArrayListDetail.tsx +165 -0
- package/src/complex/array/ArrayTable.tsx +535 -0
- package/src/complex/index.ts +16 -0
- package/src/complex/mixed/JsonTypeIcon.tsx +41 -0
- package/src/complex/mixed/MixedWidgets.tsx +326 -0
- package/src/complex/mixed/useConfirmation.tsx +34 -0
- package/src/components/ClearValueButton.tsx +56 -0
- package/src/components/ScrollRegion.tsx +27 -0
- package/src/components/TimePicker.tsx +250 -0
- package/src/components/index.ts +2 -0
- package/src/controls/AnyOfStringOrEnumControl.tsx +44 -0
- package/src/controls/BooleanControl.tsx +67 -0
- package/src/controls/BooleanToggleControl.tsx +58 -0
- package/src/controls/ChoiceCards.tsx +9 -0
- package/src/controls/DateControl.tsx +240 -0
- package/src/controls/DateTimeControl.tsx +187 -0
- package/src/controls/EnumControl.tsx +159 -0
- package/src/controls/InputControl.tsx +258 -0
- package/src/controls/IntegerControl.tsx +14 -0
- package/src/controls/NumberControl.tsx +14 -0
- package/src/controls/OneOfEnumControl.tsx +13 -0
- package/src/controls/PasswordControl.tsx +216 -0
- package/src/controls/RadioGroupControl.tsx +72 -0
- package/src/controls/SliderControl.tsx +77 -0
- package/src/controls/TextControl.tsx +50 -0
- package/src/controls/TimeControl.tsx +135 -0
- package/src/controls/index.ts +19 -0
- package/src/index.tsx +10 -0
- package/src/layouts/CategorizationLayout.tsx +248 -0
- package/src/layouts/GroupLayout.tsx +210 -0
- package/src/layouts/HorizontalLayout.tsx +12 -0
- package/src/layouts/Layout.tsx +62 -0
- package/src/layouts/ValidationIndicator.tsx +40 -0
- package/src/layouts/VerticalLayout.tsx +12 -0
- package/src/layouts/index.ts +4 -0
- package/src/renderers.ts +225 -0
- package/src/styles.css +482 -0
- package/src/tailwind-theme.cjs +42 -0
- package/src/theme.css +43 -0
- package/src/util/dateTime.ts +80 -0
- package/src/util/groupState.ts +5 -0
- package/src/util/useTemporalControl.ts +160 -0
package/src/styles.css
ADDED
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
.shadcn-jsonforms-root,
|
|
2
|
+
.shadcn-jsonforms-layout {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.shadcn-jsonforms-layout {
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: 12px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.shadcn-jsonforms-layout-column {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.shadcn-jsonforms-layout-row {
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.shadcn-jsonforms-field {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: 5px;
|
|
25
|
+
min-width: 220px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.shadcn-jsonforms-layout-row > .shadcn-jsonforms-field {
|
|
29
|
+
flex: 1 1 220px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.shadcn-jsonforms-label {
|
|
33
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
34
|
+
font-size: 13px;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.shadcn-jsonforms-input {
|
|
39
|
+
background: hsl(var(--background, 0 0% 100%));
|
|
40
|
+
border: 1px solid hsl(var(--input, 214.3 31.8% 91.4%));
|
|
41
|
+
border-radius: var(--shadcn-jsonforms-radius, 6px);
|
|
42
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
43
|
+
font: inherit;
|
|
44
|
+
min-height: 36px;
|
|
45
|
+
padding: 7px 10px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.shadcn-jsonforms-input:focus {
|
|
49
|
+
border-color: var(--shadcn-jsonforms-accent, #0f172a);
|
|
50
|
+
box-shadow: 0 0 0 3px
|
|
51
|
+
color-mix(in srgb, var(--shadcn-jsonforms-accent, #0f172a) 18%, transparent);
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.shadcn-jsonforms-description {
|
|
56
|
+
color: hsl(var(--muted-foreground, 215.4 16.3% 46.9%));
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.shadcn-jsonforms-error {
|
|
61
|
+
color: hsl(var(--destructive, 0 84.2% 60.2%));
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.shadcn-jsonforms-checkbox {
|
|
66
|
+
align-items: center;
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.shadcn-jsonforms-group,
|
|
72
|
+
.shadcn-jsonforms-array,
|
|
73
|
+
.shadcn-jsonforms-object {
|
|
74
|
+
border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
|
|
75
|
+
border-radius: var(--shadcn-jsonforms-radius, 6px);
|
|
76
|
+
display: grid;
|
|
77
|
+
gap: 12px;
|
|
78
|
+
padding: 14px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.shadcn-jsonforms-group > .shadcn-jsonforms-group-header,
|
|
82
|
+
.shadcn-jsonforms-array h3,
|
|
83
|
+
.shadcn-jsonforms-object h3 {
|
|
84
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
85
|
+
font-size: 15px;
|
|
86
|
+
font-weight: 700;
|
|
87
|
+
margin: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.shadcn-jsonforms-array-header {
|
|
91
|
+
align-items: center;
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.shadcn-jsonforms-array-actions {
|
|
97
|
+
align-items: center;
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-shrink: 0;
|
|
100
|
+
gap: 4px;
|
|
101
|
+
margin-left: auto;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.shadcn-jsonforms-array-item {
|
|
105
|
+
border-top: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
|
|
106
|
+
display: grid;
|
|
107
|
+
gap: 10px;
|
|
108
|
+
padding-top: 12px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.shadcn-jsonforms-array-item-label {
|
|
112
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
margin: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.shadcn-jsonforms-tab {
|
|
119
|
+
background: var(--shadcn-jsonforms-accent, #0f172a);
|
|
120
|
+
border: 0;
|
|
121
|
+
border-radius: var(--shadcn-jsonforms-radius, 6px);
|
|
122
|
+
color: #fff;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
font: inherit;
|
|
125
|
+
min-height: 34px;
|
|
126
|
+
padding: 7px 12px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.shadcn-jsonforms-tab:disabled {
|
|
130
|
+
cursor: not-allowed;
|
|
131
|
+
opacity: 0.5;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.shadcn-jsonforms-tabs {
|
|
135
|
+
border-bottom: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
|
|
136
|
+
display: flex;
|
|
137
|
+
gap: 6px;
|
|
138
|
+
margin-bottom: 12px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.shadcn-jsonforms-tab {
|
|
142
|
+
background: transparent;
|
|
143
|
+
border-bottom-left-radius: 0;
|
|
144
|
+
border-bottom-right-radius: 0;
|
|
145
|
+
color: hsl(var(--muted-foreground, 215.4 16.3% 46.9%));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.shadcn-jsonforms-tab[data-active] {
|
|
149
|
+
background: var(--shadcn-jsonforms-accent, #0f172a);
|
|
150
|
+
color: #fff;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.shadcn-jsonforms-static-label {
|
|
154
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
155
|
+
font-weight: 600;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* A full-width disclosure header, with status separated from the title. */
|
|
159
|
+
.shadcn-jsonforms-group > .shadcn-jsonforms-group-header {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
gap: 16px;
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: auto;
|
|
166
|
+
text-align: start;
|
|
167
|
+
white-space: normal;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.shadcn-jsonforms-group-header > button {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: space-between;
|
|
174
|
+
flex: 1 1 auto;
|
|
175
|
+
min-width: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.shadcn-jsonforms-group-heading {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: space-between;
|
|
182
|
+
flex: 1 1 auto;
|
|
183
|
+
min-width: 0;
|
|
184
|
+
font-weight: inherit;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.shadcn-jsonforms-group[data-has-regions]:not([data-collapsible])
|
|
188
|
+
> .shadcn-jsonforms-group-header {
|
|
189
|
+
justify-content: flex-start;
|
|
190
|
+
flex-wrap: wrap;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.shadcn-jsonforms-group[data-has-regions]:not([data-collapsible])
|
|
194
|
+
.shadcn-jsonforms-group-actions {
|
|
195
|
+
margin-inline-start: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.shadcn-jsonforms-group[data-has-regions] [data-group-header] {
|
|
199
|
+
display: grid;
|
|
200
|
+
gap: 4px;
|
|
201
|
+
min-width: 0;
|
|
202
|
+
flex: 1 1 auto;
|
|
203
|
+
order: -1;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.shadcn-jsonforms-group[data-has-regions]
|
|
207
|
+
[data-group-header]
|
|
208
|
+
.group-header-title
|
|
209
|
+
.shadcn-jsonforms-static-label {
|
|
210
|
+
font-size: 1rem;
|
|
211
|
+
font-weight: 600;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.shadcn-jsonforms-group[data-has-regions]
|
|
215
|
+
[data-group-header]
|
|
216
|
+
.group-header-detail
|
|
217
|
+
.shadcn-jsonforms-static-label {
|
|
218
|
+
font-size: 0.875rem;
|
|
219
|
+
font-weight: 400;
|
|
220
|
+
color: hsl(var(--muted-foreground));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.shadcn-jsonforms-group-region-header {
|
|
224
|
+
padding-block: 12px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.shadcn-jsonforms-group-cover img {
|
|
228
|
+
display: block;
|
|
229
|
+
width: 100%;
|
|
230
|
+
max-width: 100%;
|
|
231
|
+
object-fit: cover;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.shadcn-jsonforms-group[data-has-regions] {
|
|
235
|
+
gap: 0;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
padding: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.shadcn-jsonforms-group[data-has-regions]:not([data-collapsible])
|
|
241
|
+
> .shadcn-jsonforms-group-header {
|
|
242
|
+
padding: 12px 16px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.shadcn-jsonforms-group[data-has-regions]:not([data-collapsible])
|
|
246
|
+
> .shadcn-jsonforms-group-content {
|
|
247
|
+
padding: 0 16px 16px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.shadcn-jsonforms-group[data-has-regions]:not([data-collapsible])
|
|
251
|
+
> .shadcn-jsonforms-group-footer {
|
|
252
|
+
padding-inline: 16px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.shadcn-jsonforms-group-footer {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-wrap: wrap;
|
|
258
|
+
align-items: center;
|
|
259
|
+
gap: 8px;
|
|
260
|
+
padding-top: 16px;
|
|
261
|
+
padding-inline: 0;
|
|
262
|
+
border-top: 1px solid hsl(var(--border));
|
|
263
|
+
margin-top: 16px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.shadcn-jsonforms-group-title {
|
|
267
|
+
min-width: 0;
|
|
268
|
+
overflow-wrap: anywhere;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.shadcn-jsonforms-group-actions {
|
|
272
|
+
display: inline-flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
flex-shrink: 0;
|
|
275
|
+
gap: 12px;
|
|
276
|
+
margin-inline-start: auto;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.shadcn-jsonforms-group-actions [data-group-indicator] {
|
|
280
|
+
font-size: 10px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.shadcn-jsonforms-group[data-collapsible] {
|
|
284
|
+
display: block;
|
|
285
|
+
border: 0;
|
|
286
|
+
border-radius: 12px;
|
|
287
|
+
padding: 0;
|
|
288
|
+
background: hsl(var(--muted, 210 40% 96.1%));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.shadcn-jsonforms-group[data-collapsible] > .shadcn-jsonforms-group-header {
|
|
292
|
+
padding: 12px 16px;
|
|
293
|
+
border-radius: inherit;
|
|
294
|
+
color: hsl(var(--foreground, 222.2 84% 4.9%));
|
|
295
|
+
font-size: 16px;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.shadcn-jsonforms-group[data-collapsible] > .shadcn-jsonforms-group-content {
|
|
300
|
+
padding: 0 16px 16px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.shadcn-jsonforms-group[data-has-regions][data-collapsible] {
|
|
304
|
+
border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
|
|
305
|
+
background: hsl(var(--background, 0 0% 100%));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.shadcn-jsonforms-group[data-has-regions][data-collapsible]
|
|
309
|
+
> .shadcn-jsonforms-group-header {
|
|
310
|
+
flex-wrap: wrap;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.shadcn-jsonforms-group[data-has-regions][data-collapsible]
|
|
314
|
+
> .shadcn-jsonforms-group-header
|
|
315
|
+
[data-group-header] {
|
|
316
|
+
flex: 1 1 auto;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Let AG Grid provide cell boundaries and keyboard-focus indication. */
|
|
320
|
+
.ag-cell:has(.shadcn-jsonforms-grid-cell) {
|
|
321
|
+
padding-inline: 0;
|
|
322
|
+
}
|
|
323
|
+
.ag-cell:has(.shadcn-jsonforms-grid-cell) .ag-cell-wrapper,
|
|
324
|
+
.ag-cell:has(.shadcn-jsonforms-grid-cell) .ag-cell-value,
|
|
325
|
+
.shadcn-jsonforms-grid-cell-content,
|
|
326
|
+
.shadcn-jsonforms-grid-cell-content > .shadcn-jsonforms-cell,
|
|
327
|
+
.shadcn-jsonforms-grid-cell-content > .shadcn-jsonforms-cell > .group {
|
|
328
|
+
height: 100%;
|
|
329
|
+
width: 100%;
|
|
330
|
+
min-width: 0;
|
|
331
|
+
}
|
|
332
|
+
.shadcn-jsonforms-grid-cell input:not([type='checkbox']):not([type='color']),
|
|
333
|
+
.shadcn-jsonforms-grid-cell button[role='combobox'] {
|
|
334
|
+
width: 100%;
|
|
335
|
+
height: 100%;
|
|
336
|
+
min-height: 0;
|
|
337
|
+
border: 0;
|
|
338
|
+
border-radius: 0;
|
|
339
|
+
background: transparent;
|
|
340
|
+
box-shadow: none;
|
|
341
|
+
outline: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* The shared grid suppresses its own cell focus border. Keep one indication. */
|
|
345
|
+
.shadcn-jsonforms-grid-cell:focus-within {
|
|
346
|
+
box-shadow: inset 0 0 0 2px hsl(var(--ring, 222.2 84% 4.9%));
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* A compact focus halo fits table rows without the full-size input ring. */
|
|
350
|
+
.shadcn-jsonforms-table-cell
|
|
351
|
+
input:not([type='checkbox']):not([type='color']):focus-visible,
|
|
352
|
+
.shadcn-jsonforms-table-cell button[role='combobox']:focus-visible {
|
|
353
|
+
outline: none;
|
|
354
|
+
border-color: var(--shadcn-jsonforms-accent, #0f172a);
|
|
355
|
+
box-shadow: 0 0 0 1px
|
|
356
|
+
color-mix(in srgb, var(--shadcn-jsonforms-accent, #0f172a) 20%, transparent);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.shadcn-jsonforms-table-cell:has(.shadcn-jsonforms-cell-error) {
|
|
360
|
+
position: relative;
|
|
361
|
+
padding-inline-end: 40px;
|
|
362
|
+
}
|
|
363
|
+
.shadcn-jsonforms-table-cell .shadcn-jsonforms-cell-error {
|
|
364
|
+
position: absolute;
|
|
365
|
+
inset-inline-end: 8px;
|
|
366
|
+
top: 50%;
|
|
367
|
+
transform: translateY(-50%);
|
|
368
|
+
}
|
|
369
|
+
.shadcn-jsonforms-table-cell:has(.shadcn-jsonforms-cell-error) input,
|
|
370
|
+
.shadcn-jsonforms-table-cell:has(.shadcn-jsonforms-cell-error)
|
|
371
|
+
button[role='combobox'] {
|
|
372
|
+
border-color: hsl(var(--destructive, 0 84% 60%));
|
|
373
|
+
box-shadow: 0 0 0 1px hsl(var(--destructive, 0 84% 60%) / 0.25);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Keep wide tables inside the panel; only the table body scrolls. */
|
|
377
|
+
.shadcn-jsonforms-array,
|
|
378
|
+
.shadcn-jsonforms-object {
|
|
379
|
+
min-width: 0;
|
|
380
|
+
max-width: 100%;
|
|
381
|
+
grid-template-columns: minmax(0, 1fr);
|
|
382
|
+
}
|
|
383
|
+
.shadcn-jsonforms-array > div,
|
|
384
|
+
.shadcn-jsonforms-categorization,
|
|
385
|
+
.shadcn-jsonforms-categorization > [role='tabpanel'] {
|
|
386
|
+
min-width: 0;
|
|
387
|
+
max-width: 100%;
|
|
388
|
+
}
|
|
389
|
+
.shadcn-jsonforms-array-header > :first-child {
|
|
390
|
+
min-width: 0;
|
|
391
|
+
overflow-wrap: anywhere;
|
|
392
|
+
}
|
|
393
|
+
.shadcn-jsonforms-array-header > :last-child {
|
|
394
|
+
flex-shrink: 0;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.jsonforms-mixed-renderer-primitive,
|
|
398
|
+
.jsonforms-mixed-renderer-detail-primitive {
|
|
399
|
+
display: grid;
|
|
400
|
+
grid-template-columns: 140px minmax(0, 1fr);
|
|
401
|
+
align-items: start;
|
|
402
|
+
gap: 8px;
|
|
403
|
+
}
|
|
404
|
+
@media (max-width: 600px) {
|
|
405
|
+
.jsonforms-mixed-renderer-primitive,
|
|
406
|
+
.jsonforms-mixed-renderer-detail-primitive {
|
|
407
|
+
grid-template-columns: minmax(0, 1fr);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* The mixed workspace's object panel supplies the detail outline. */
|
|
412
|
+
.jsonforms-mixed-renderer-detail-control
|
|
413
|
+
> .shadcn-jsonforms-object
|
|
414
|
+
> .shadcn-jsonforms-group,
|
|
415
|
+
.jsonforms-mixed-renderer-detail-control
|
|
416
|
+
> .shadcn-jsonforms-object
|
|
417
|
+
> .jsonforms-additional-properties {
|
|
418
|
+
border: 0;
|
|
419
|
+
box-shadow: none;
|
|
420
|
+
}
|
|
421
|
+
.jsonforms-mixed-renderer-detail-control
|
|
422
|
+
> .shadcn-jsonforms-object
|
|
423
|
+
> .shadcn-jsonforms-group {
|
|
424
|
+
padding: 0;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/* Preserve native checkbox behavior while keeping row selectors visible in both themes. */
|
|
428
|
+
.shadcn-jsonforms-row-selection[data-state='unchecked'] {
|
|
429
|
+
border-color: color-mix(
|
|
430
|
+
in srgb,
|
|
431
|
+
hsl(var(--muted-foreground)) 60%,
|
|
432
|
+
hsl(var(--background))
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
.shadcn-jsonforms-row-selection:disabled {
|
|
436
|
+
opacity: 1;
|
|
437
|
+
}
|
|
438
|
+
.shadcn-jsonforms-row-selection:disabled[data-state='unchecked'] {
|
|
439
|
+
background-color: hsl(var(--muted));
|
|
440
|
+
}
|
|
441
|
+
.shadcn-jsonforms-row-selection[data-state='indeterminate'] {
|
|
442
|
+
border-color: hsl(var(--primary));
|
|
443
|
+
background-color: hsl(var(--primary));
|
|
444
|
+
color: hsl(var(--primary-foreground));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/* Constrain the viewport, not its content, for flex panels and capped lists. */
|
|
448
|
+
.shadcn-jsonforms-scroll-region > [data-slot='scroll-area-viewport'] {
|
|
449
|
+
max-height: inherit;
|
|
450
|
+
min-height: 0;
|
|
451
|
+
height: auto;
|
|
452
|
+
flex: 1 1 auto;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* Radix's table wrapper otherwise expands to the full, untruncated label.
|
|
456
|
+
Reserve only enough width for the avatar and actions; narrower panes scroll. */
|
|
457
|
+
.shadcn-jsonforms-list-navigation > [data-slot='scroll-area-viewport'] > div {
|
|
458
|
+
display: block !important;
|
|
459
|
+
width: 100%;
|
|
460
|
+
min-width: 10rem !important;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/* Carry the split pane's definite height through Radix's content wrapper so
|
|
464
|
+
percentage-height grids retain their body as well as their pagination. */
|
|
465
|
+
.shadcn-jsonforms-collection-pane > [data-slot='scroll-area-viewport'] {
|
|
466
|
+
height: 100%;
|
|
467
|
+
}
|
|
468
|
+
.shadcn-jsonforms-collection-pane > [data-slot='scroll-area-viewport'] > div {
|
|
469
|
+
height: 100%;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* Tab labels must not determine the minimum width of a form or split pane. */
|
|
473
|
+
.shadcn-jsonforms-categorization > [role='tablist'] {
|
|
474
|
+
max-width: 100%;
|
|
475
|
+
min-width: 0;
|
|
476
|
+
justify-content: flex-start;
|
|
477
|
+
overflow-x: auto;
|
|
478
|
+
overflow-y: hidden;
|
|
479
|
+
}
|
|
480
|
+
.shadcn-jsonforms-categorization > [role='tablist'] > [role='tab'] {
|
|
481
|
+
flex: 0 0 auto;
|
|
482
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
colors: {
|
|
3
|
+
border: 'hsl(var(--border))',
|
|
4
|
+
input: 'hsl(var(--input))',
|
|
5
|
+
ring: 'hsl(var(--ring))',
|
|
6
|
+
background: 'hsl(var(--background))',
|
|
7
|
+
foreground: 'hsl(var(--foreground))',
|
|
8
|
+
card: {
|
|
9
|
+
DEFAULT: 'hsl(var(--card))',
|
|
10
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
11
|
+
},
|
|
12
|
+
primary: {
|
|
13
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
14
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
15
|
+
},
|
|
16
|
+
secondary: {
|
|
17
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
18
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
19
|
+
},
|
|
20
|
+
destructive: {
|
|
21
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
22
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
23
|
+
},
|
|
24
|
+
muted: {
|
|
25
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
26
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
27
|
+
},
|
|
28
|
+
accent: {
|
|
29
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
30
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
31
|
+
},
|
|
32
|
+
popover: {
|
|
33
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
34
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
borderRadius: {
|
|
38
|
+
lg: 'var(--radius)',
|
|
39
|
+
md: 'calc(var(--radius) - 2px)',
|
|
40
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
41
|
+
},
|
|
42
|
+
};
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@utility jsonforms-theme-light {
|
|
2
|
+
--background: 0 0% 100%;
|
|
3
|
+
--foreground: 222.2 84% 4.9%;
|
|
4
|
+
--card: 0 0% 100%;
|
|
5
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
6
|
+
--popover: 0 0% 100%;
|
|
7
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
8
|
+
--primary: 222.2 47.4% 11.2%;
|
|
9
|
+
--primary-foreground: 210 40% 98%;
|
|
10
|
+
--secondary: 210 40% 96.1%;
|
|
11
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
12
|
+
--muted: 210 40% 96.1%;
|
|
13
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
14
|
+
--accent: 210 40% 96.1%;
|
|
15
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
16
|
+
--destructive: 0 84.2% 60.2%;
|
|
17
|
+
--destructive-foreground: 210 40% 98%;
|
|
18
|
+
--border: 214.3 31.8% 91.4%;
|
|
19
|
+
--input: 214.3 31.8% 91.4%;
|
|
20
|
+
--ring: 222.2 84% 4.9%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@utility jsonforms-theme-dark {
|
|
24
|
+
--background: 0 0% 8%;
|
|
25
|
+
--foreground: 0 0% 98%;
|
|
26
|
+
--card: 0 0% 9%;
|
|
27
|
+
--card-foreground: 0 0% 98%;
|
|
28
|
+
--popover: 0 0% 9%;
|
|
29
|
+
--popover-foreground: 0 0% 98%;
|
|
30
|
+
--primary: 0 0% 98%;
|
|
31
|
+
--primary-foreground: 0 0% 9%;
|
|
32
|
+
--secondary: 0 0% 14.9%;
|
|
33
|
+
--secondary-foreground: 0 0% 98%;
|
|
34
|
+
--muted: 0 0% 14.9%;
|
|
35
|
+
--muted-foreground: 0 0% 63.9%;
|
|
36
|
+
--accent: 0 0% 14.9%;
|
|
37
|
+
--accent-foreground: 0 0% 98%;
|
|
38
|
+
--destructive: 0 84.2% 60.2%;
|
|
39
|
+
--destructive-foreground: 210 40% 98%;
|
|
40
|
+
--border: 0 0% 18%;
|
|
41
|
+
--input: 0 0% 22%;
|
|
42
|
+
--ring: 0 0% 83%;
|
|
43
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { resolveIntlLocale } from '@chobantonov/jsonforms-react-renderer-common/locale/intl';
|
|
2
|
+
const pad = (value: number) => String(value).padStart(2, '0');
|
|
3
|
+
|
|
4
|
+
export type TimeValue = {
|
|
5
|
+
hours: number;
|
|
6
|
+
minutes: number;
|
|
7
|
+
seconds: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const parseDateValue = (value: unknown): Date | undefined => {
|
|
11
|
+
if (typeof value !== 'string') return undefined;
|
|
12
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})/.exec(value);
|
|
13
|
+
if (!match) return undefined;
|
|
14
|
+
|
|
15
|
+
const date = new Date(
|
|
16
|
+
Number(match[1]),
|
|
17
|
+
Number(match[2]) - 1,
|
|
18
|
+
Number(match[3]),
|
|
19
|
+
);
|
|
20
|
+
return date.getFullYear() === Number(match[1]) &&
|
|
21
|
+
date.getMonth() === Number(match[2]) - 1 &&
|
|
22
|
+
date.getDate() === Number(match[3])
|
|
23
|
+
? date
|
|
24
|
+
: undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const formatDateValue = (date: Date) =>
|
|
28
|
+
`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
29
|
+
|
|
30
|
+
export const formatDisplayDate = (date: Date, locale?: string) =>
|
|
31
|
+
new Intl.DateTimeFormat(resolveIntlLocale(locale), {
|
|
32
|
+
year: 'numeric',
|
|
33
|
+
month: 'short',
|
|
34
|
+
day: '2-digit',
|
|
35
|
+
}).format(date);
|
|
36
|
+
|
|
37
|
+
export const parseTimeValue = (value: unknown): TimeValue | undefined => {
|
|
38
|
+
if (typeof value !== 'string') return undefined;
|
|
39
|
+
const match = /(?:T)?(\d{2}):(\d{2})(?::(\d{2}))?/.exec(value);
|
|
40
|
+
if (!match) return undefined;
|
|
41
|
+
|
|
42
|
+
const result = {
|
|
43
|
+
hours: Number(match[1]),
|
|
44
|
+
minutes: Number(match[2]),
|
|
45
|
+
seconds: Number(match[3] ?? 0),
|
|
46
|
+
};
|
|
47
|
+
return result.hours < 24 && result.minutes < 60 && result.seconds < 60
|
|
48
|
+
? result
|
|
49
|
+
: undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const formatTimeValue = (time: TimeValue, useSeconds = true) => {
|
|
53
|
+
const value = `${pad(time.hours)}:${pad(time.minutes)}`;
|
|
54
|
+
return useSeconds ? `${value}:${pad(time.seconds)}` : value;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const formatDisplayTime = (time: TimeValue, ampm = false) => {
|
|
58
|
+
if (!ampm) return formatTimeValue(time, time.seconds !== 0);
|
|
59
|
+
const period = time.hours >= 12 ? 'PM' : 'AM';
|
|
60
|
+
const hours = time.hours % 12 || 12;
|
|
61
|
+
const value = `${pad(hours)}:${pad(time.minutes)}`;
|
|
62
|
+
return `${time.seconds ? `${value}:${pad(time.seconds)}` : value} ${period}`;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const formatDateTimeValue = (date: Date, time: TimeValue) => {
|
|
66
|
+
const offset = -date.getTimezoneOffset();
|
|
67
|
+
const sign = offset >= 0 ? '+' : '-';
|
|
68
|
+
const offsetHours = pad(Math.floor(Math.abs(offset) / 60));
|
|
69
|
+
const offsetMinutes = pad(Math.abs(offset) % 60);
|
|
70
|
+
return `${formatDateValue(date)}T${formatTimeValue(
|
|
71
|
+
time,
|
|
72
|
+
)}${sign}${offsetHours}:${offsetMinutes}`;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const formatDisplayDateTime = (
|
|
76
|
+
date: Date,
|
|
77
|
+
time: TimeValue,
|
|
78
|
+
ampm = false,
|
|
79
|
+
locale?: string,
|
|
80
|
+
) => `${formatDisplayDate(date, locale)}, ${formatDisplayTime(time, ampm)}`;
|