@infonomic/uikit 5.44.0 → 6.0.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/README.md +1 -1
- package/dist/components/accordion/accordion.d.ts +9 -9
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +4 -4
- package/dist/components/accordion/accordion.module.css +6 -5
- package/dist/components/accordion/accordion_module.css +4 -4
- package/dist/components/avatar/avatar.js +2 -2
- package/dist/components/badge/badge.d.ts +5 -13
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +12 -9
- package/dist/components/button/button-group.d.ts +9 -7
- package/dist/components/button/button-group.d.ts.map +1 -1
- package/dist/components/button/button-group.js +26 -36
- package/dist/components/button/button.d.ts +6 -13
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +19 -18
- package/dist/components/button/button.module.css +32 -54
- package/dist/components/button/button_module.css +7 -10
- package/dist/components/button/combo-button.d.ts +1 -1
- package/dist/components/button/combo-button.d.ts.map +1 -1
- package/dist/components/button/combo-button.js +13 -9
- package/dist/components/button/combo-button.module.css +16 -7
- package/dist/components/button/combo-button_module.css +22 -4
- package/dist/components/button/icon-button.d.ts +2 -3
- package/dist/components/button/icon-button.d.ts.map +1 -1
- package/dist/components/card/card.d.ts +5 -12
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +13 -9
- package/dist/components/chips/chip.d.ts +5 -11
- package/dist/components/chips/chip.d.ts.map +1 -1
- package/dist/components/chips/chip.js +36 -28
- package/dist/components/chips/chip.module.css +22 -36
- package/dist/components/chips/chip_module.css +3 -6
- package/dist/components/dropdown/dropdown.d.ts +28 -14
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.js +34 -20
- package/dist/components/forms/calendar.d.ts +1 -1
- package/dist/components/forms/calendar.d.ts.map +1 -1
- package/dist/components/forms/calendar.js +38 -29
- package/dist/components/forms/checkbox.astro +13 -8
- package/dist/components/forms/checkbox.d.ts +6 -2
- package/dist/components/forms/checkbox.d.ts.map +1 -1
- package/dist/components/forms/checkbox.js +11 -7
- package/dist/components/forms/checkbox.module.css +20 -20
- package/dist/components/forms/checkbox_module.css +13 -10
- package/dist/components/forms/input.module.css +10 -11
- package/dist/components/forms/input_module.css +3 -5
- package/dist/components/forms/radio-group.d.ts +6 -5
- package/dist/components/forms/radio-group.d.ts.map +1 -1
- package/dist/components/forms/radio-group.js +9 -4
- package/dist/components/forms/radio-group.module.css +13 -22
- package/dist/components/forms/radio-group_module.css +6 -24
- package/dist/components/forms/select.d.ts +4 -5
- package/dist/components/forms/select.d.ts.map +1 -1
- package/dist/components/forms/select.js +27 -29
- package/dist/components/forms/select.module.css +22 -22
- package/dist/components/forms/select.module.js +15 -15
- package/dist/components/forms/select_module.css +15 -15
- package/dist/components/notifications/@types/toast.d.ts +9 -7
- package/dist/components/notifications/@types/toast.d.ts.map +1 -1
- package/dist/components/notifications/toast.d.ts +12 -16
- package/dist/components/notifications/toast.d.ts.map +1 -1
- package/dist/components/notifications/toast.js +73 -57
- package/dist/components/notifications/toast.module.css +151 -177
- package/dist/components/notifications/toast.module.js +8 -12
- package/dist/components/notifications/toast_module.css +114 -159
- package/dist/components/pager/first-button.d.ts +2 -2
- package/dist/components/pager/first-button.d.ts.map +1 -1
- package/dist/components/pager/first-button.js +23 -16
- package/dist/components/pager/last-button.d.ts +2 -2
- package/dist/components/pager/last-button.d.ts.map +1 -1
- package/dist/components/pager/last-button.js +23 -16
- package/dist/components/pager/next-button.d.ts +2 -2
- package/dist/components/pager/next-button.d.ts.map +1 -1
- package/dist/components/pager/next-button.js +27 -20
- package/dist/components/pager/number-button.d.ts +2 -2
- package/dist/components/pager/number-button.d.ts.map +1 -1
- package/dist/components/pager/number-button.js +28 -23
- package/dist/components/pager/pagination.d.ts +8 -13
- package/dist/components/pager/pagination.d.ts.map +1 -1
- package/dist/components/pager/previous-button.d.ts +2 -2
- package/dist/components/pager/previous-button.d.ts.map +1 -1
- package/dist/components/pager/previous-button.js +25 -18
- package/dist/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +4 -2
- package/dist/components/tabs/tabs.d.ts +13 -13
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +8 -8
- package/dist/components/tabs/tabs.module.css +8 -17
- package/dist/components/tabs/tabs_module.css +1 -1
- package/dist/components/tooltip/tooltip.d.ts +6 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +49 -20
- package/dist/components/tooltip/tooltip.module.css +43 -10
- package/dist/components/tooltip/tooltip.module.js +7 -1
- package/dist/components/tooltip/tooltip_module.css +36 -4
- package/dist/hooks/use-focus-trap/index.d.ts +2 -0
- package/dist/hooks/use-focus-trap/index.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/index.js +1 -0
- package/dist/hooks/use-focus-trap/scope-tab.d.ts +11 -0
- package/dist/hooks/use-focus-trap/scope-tab.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/scope-tab.js +19 -0
- package/dist/hooks/use-focus-trap/tabbable.d.ts +14 -0
- package/dist/hooks/use-focus-trap/tabbable.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/tabbable.js +36 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.d.ts +11 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.js +45 -0
- package/dist/icons/chevron-up-icon.d.ts +7 -0
- package/dist/icons/chevron-up-icon.d.ts.map +1 -0
- package/dist/icons/chevron-up-icon.js +27 -0
- package/dist/lib/ripple.d.ts +25 -0
- package/dist/lib/ripple.d.ts.map +1 -0
- package/dist/lib/ripple.js +53 -0
- package/dist/styles/components-vanilla.css +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
- package/dist/widgets/datepicker/datepicker.js +118 -116
- package/dist/widgets/datepicker/datepicker.module.css +6 -5
- package/dist/widgets/datepicker/datepicker_module.css +4 -4
- package/dist/widgets/drawer/drawer-wrapper.d.ts.map +1 -1
- package/dist/widgets/drawer/drawer-wrapper.js +1 -1
- package/dist/widgets/modal/modal-wrapper.d.ts.map +1 -1
- package/dist/widgets/modal/modal-wrapper.js +1 -1
- package/package.json +2 -6
- package/src/components/accordion/accordion.module.css +6 -5
- package/src/components/accordion/accordion.stories.tsx +10 -13
- package/src/components/accordion/accordion.tsx +13 -13
- package/src/components/avatar/avatar.tsx +2 -2
- package/src/components/badge/badge.tsx +20 -29
- package/src/components/button/button-group.tsx +60 -44
- package/src/components/button/button.module.css +32 -54
- package/src/components/button/button.tsx +35 -47
- package/src/components/button/combo-button.module.css +16 -7
- package/src/components/button/combo-button.tsx +17 -9
- package/src/components/button/icon-button.tsx +3 -5
- package/src/components/card/card.tsx +20 -32
- package/src/components/chips/chip.module.css +22 -36
- package/src/components/chips/chip.stories.tsx +2 -2
- package/src/components/chips/chip.tsx +59 -57
- package/src/components/dropdown/dropdown.stories.tsx +2 -4
- package/src/components/dropdown/dropdown.tsx +86 -40
- package/src/components/forms/calendar.tsx +43 -33
- package/src/components/forms/checkbox-group.tsx +1 -1
- package/src/components/forms/checkbox.astro +13 -8
- package/src/components/forms/checkbox.module.css +20 -20
- package/src/components/forms/checkbox.tsx +11 -6
- package/src/components/forms/input.module.css +10 -11
- package/src/components/forms/radio-group.module.css +13 -22
- package/src/components/forms/radio-group.tsx +13 -11
- package/src/components/forms/select.module.css +22 -22
- package/src/components/forms/select.tsx +36 -33
- package/src/components/notifications/@types/toast.ts +9 -7
- package/src/components/notifications/toast.module.css +151 -177
- package/src/components/notifications/toast.stories.tsx +21 -23
- package/src/components/notifications/toast.tsx +90 -86
- package/src/components/pager/first-button.tsx +24 -26
- package/src/components/pager/last-button.tsx +24 -25
- package/src/components/pager/next-button.tsx +24 -23
- package/src/components/pager/number-button.tsx +37 -36
- package/src/components/pager/pagination.tsx +4 -11
- package/src/components/pager/previous-button.tsx +24 -24
- package/src/components/scroll-area/scroll-area.tsx +3 -3
- package/src/components/tabs/tabs.module.css +8 -17
- package/src/components/tabs/tabs.stories.tsx +5 -5
- package/src/components/tabs/tabs.tsx +17 -16
- package/src/components/tooltip/tooltip.module.css +43 -10
- package/src/components/tooltip/tooltip.stories.tsx +4 -4
- package/src/components/tooltip/tooltip.tsx +56 -28
- package/src/hooks/use-focus-trap/index.ts +1 -0
- package/src/hooks/use-focus-trap/scope-tab.ts +48 -0
- package/src/hooks/use-focus-trap/tabbable.ts +72 -0
- package/src/hooks/use-focus-trap/use-focus-trap.ts +83 -0
- package/src/icons/chevron-up-icon.tsx +37 -0
- package/src/lib/ripple.ts +95 -0
- package/src/widgets/datepicker/datepicker.module.css +6 -5
- package/src/widgets/datepicker/datepicker.tsx +137 -135
- package/src/widgets/drawer/drawer-wrapper.tsx +1 -1
- package/src/widgets/modal/modal-wrapper.tsx +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Popover } from "@base-ui/react/popover";
|
|
4
5
|
import classnames from "classnames";
|
|
5
6
|
import { format } from "date-fns";
|
|
6
|
-
import { Popover } from "radix-ui";
|
|
7
7
|
import { Button } from "../../components/button/button.js";
|
|
8
8
|
import { IconButton } from "../../components/button/icon-button.js";
|
|
9
9
|
import { Calendar } from "../../components/forms/calendar.js";
|
|
@@ -119,137 +119,139 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
|
|
|
119
119
|
onOpenChange: setIsOpen,
|
|
120
120
|
children: [
|
|
121
121
|
/*#__PURE__*/ jsx(Popover.Trigger, {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
nativeButton: false,
|
|
123
|
+
render: /*#__PURE__*/ jsx("div", {
|
|
124
124
|
style: {
|
|
125
125
|
position: 'relative',
|
|
126
126
|
height: '1px'
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
130
|
+
className: "sr-only",
|
|
131
|
+
children: "Select date"
|
|
132
132
|
})
|
|
133
133
|
}),
|
|
134
134
|
/*#__PURE__*/ jsx(Popover.Portal, {
|
|
135
|
-
children: /*#__PURE__*/
|
|
135
|
+
children: /*#__PURE__*/ jsx(Popover.Positioner, {
|
|
136
136
|
sideOffset: 5,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
137
|
+
children: /*#__PURE__*/ jsxs(Popover.Popup, {
|
|
138
|
+
className: classnames('infonomic-datepicker-content', datepicker_module.content, contentClassName),
|
|
139
|
+
children: [
|
|
140
|
+
/*#__PURE__*/ jsxs("div", {
|
|
141
|
+
className: classnames('infonomic-datepicker-content-components', datepicker_module["content-components"]),
|
|
142
|
+
children: [
|
|
143
|
+
/*#__PURE__*/ jsx("div", {
|
|
144
|
+
ref: calendarRef,
|
|
145
|
+
children: /*#__PURE__*/ jsx(Calendar, {
|
|
146
|
+
mode: "single",
|
|
147
|
+
required: true,
|
|
148
|
+
captionLayout: "dropdown",
|
|
149
|
+
selected: date ?? void 0,
|
|
150
|
+
month: month ?? void 0,
|
|
151
|
+
onMonthChange: setMonth,
|
|
152
|
+
onSelect: (selectedDate)=>{
|
|
153
|
+
if (selectedDate) {
|
|
154
|
+
const [hours, minutes] = time.split(':');
|
|
155
|
+
selectedDate.setHours(Number.parseInt(hours, 10), Number.parseInt(minutes, 10));
|
|
156
|
+
setDate(selectedDate);
|
|
157
|
+
setMonth(selectedDate);
|
|
158
|
+
handleOnDateChange(selectedDate);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
startMonth: new Date(new Date().getFullYear() - yearsInPast, 0),
|
|
162
|
+
endMonth: new Date(new Date().getFullYear() + yearsInFuture, 0)
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
165
|
+
'datetime' === mode && /*#__PURE__*/ jsx("div", {
|
|
166
|
+
className: datepicker_module["time-picker-container"],
|
|
167
|
+
children: /*#__PURE__*/ jsx(ScrollArea, {
|
|
168
|
+
className: datepicker_module["time-picker-scroll-area"],
|
|
169
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
170
|
+
className: datepicker_module["time-picker"],
|
|
171
|
+
children: Array.from({
|
|
172
|
+
length: 96
|
|
173
|
+
}).map((_, i)=>{
|
|
174
|
+
const hour = Math.floor(i / 4).toString().padStart(2, '0');
|
|
175
|
+
const minute = (i % 4 * 15).toString().padStart(2, '0');
|
|
176
|
+
const timeValue = `${hour}:${minute}`;
|
|
177
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
178
|
+
size: "sm",
|
|
179
|
+
className: datepicker_module["time-picker-button"],
|
|
180
|
+
variant: "outlined",
|
|
181
|
+
onClick: ()=>{
|
|
182
|
+
setTime(timeValue);
|
|
183
|
+
if (date) {
|
|
184
|
+
const newDate = new Date(date.getTime());
|
|
185
|
+
newDate.setHours(Number.parseInt(hour, 10), Number.parseInt(minute, 10), 0);
|
|
186
|
+
setDate(newDate);
|
|
187
|
+
handleOnDateChange(newDate);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
children: timeValue
|
|
191
|
+
}, i);
|
|
192
|
+
})
|
|
191
193
|
})
|
|
192
194
|
})
|
|
193
195
|
})
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
children: /*#__PURE__*/ jsx(Button, {
|
|
209
|
-
variant: "outlined",
|
|
210
|
-
size: "sm",
|
|
211
|
-
className: classnames('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
|
|
212
|
-
onClick: ()=>{
|
|
213
|
-
const today = new Date();
|
|
214
|
-
setDate(today);
|
|
215
|
-
setMonth(today);
|
|
216
|
-
handleOnDateChange(today);
|
|
217
|
-
},
|
|
218
|
-
children: "Today"
|
|
219
|
-
})
|
|
220
|
-
}),
|
|
221
|
-
/*#__PURE__*/ jsxs("div", {
|
|
222
|
-
style: {
|
|
223
|
-
display: 'flex',
|
|
224
|
-
gap: 'var(--spacing-12)'
|
|
225
|
-
},
|
|
226
|
-
children: [
|
|
227
|
-
/*#__PURE__*/ jsx(Button, {
|
|
228
|
-
size: "sm",
|
|
229
|
-
intent: "noeffect",
|
|
230
|
-
className: classnames('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
|
|
231
|
-
onClick: ()=>{
|
|
232
|
-
setIsOpen(false);
|
|
233
|
-
},
|
|
234
|
-
children: "Cancel"
|
|
235
|
-
}),
|
|
236
|
-
/*#__PURE__*/ jsx(Button, {
|
|
196
|
+
]
|
|
197
|
+
}),
|
|
198
|
+
/*#__PURE__*/ jsxs("div", {
|
|
199
|
+
className: classnames('infonomic-datepicker-status-and-actions', datepicker_module["status-and-actions"]),
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ jsx("div", {
|
|
202
|
+
className: classnames('infonomic-datepicker-content-status', datepicker_module["content-status"]),
|
|
203
|
+
children: date ? format(date, 'datetime' === mode ? 'PPPp' : 'PPP') : 'No date selected'
|
|
204
|
+
}),
|
|
205
|
+
/*#__PURE__*/ jsxs("div", {
|
|
206
|
+
className: classnames('infonomic-datepicker-content-actions', datepicker_module["content-actions"]),
|
|
207
|
+
children: [
|
|
208
|
+
/*#__PURE__*/ jsx("div", {
|
|
209
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
237
210
|
variant: "outlined",
|
|
238
211
|
size: "sm",
|
|
239
212
|
className: classnames('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
|
|
240
213
|
onClick: ()=>{
|
|
241
|
-
|
|
242
|
-
|
|
214
|
+
const today = new Date();
|
|
215
|
+
setDate(today);
|
|
216
|
+
setMonth(today);
|
|
217
|
+
handleOnDateChange(today);
|
|
243
218
|
},
|
|
244
|
-
children: "
|
|
219
|
+
children: "Today"
|
|
245
220
|
})
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
221
|
+
}),
|
|
222
|
+
/*#__PURE__*/ jsxs("div", {
|
|
223
|
+
style: {
|
|
224
|
+
display: 'flex',
|
|
225
|
+
gap: 'var(--spacing-12)'
|
|
226
|
+
},
|
|
227
|
+
children: [
|
|
228
|
+
/*#__PURE__*/ jsx(Button, {
|
|
229
|
+
size: "sm",
|
|
230
|
+
intent: "noeffect",
|
|
231
|
+
className: classnames('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
|
|
232
|
+
onClick: ()=>{
|
|
233
|
+
setIsOpen(false);
|
|
234
|
+
},
|
|
235
|
+
children: "Cancel"
|
|
236
|
+
}),
|
|
237
|
+
/*#__PURE__*/ jsx(Button, {
|
|
238
|
+
variant: "outlined",
|
|
239
|
+
size: "sm",
|
|
240
|
+
className: classnames('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
|
|
241
|
+
onClick: ()=>{
|
|
242
|
+
setIsOpen(false);
|
|
243
|
+
handleOnDateChange(date);
|
|
244
|
+
},
|
|
245
|
+
children: "Select"
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
})
|
|
253
255
|
})
|
|
254
256
|
})
|
|
255
257
|
]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
+
|
|
4
5
|
.container,
|
|
5
6
|
:global(.infonomic-datepicker-container) {
|
|
6
7
|
position: relative;
|
|
@@ -33,19 +34,19 @@
|
|
|
33
34
|
box-shadow: var(--shadow-md);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
&[data-
|
|
37
|
+
&[data-open][data-side="top"] {
|
|
37
38
|
animation-name: slideDownAndFade;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
&[data-
|
|
41
|
+
&[data-open][data-side="right"] {
|
|
41
42
|
animation-name: slideLeftAndFade;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
&[data-
|
|
45
|
+
&[data-open][data-side="bottom"] {
|
|
45
46
|
animation-name: slideUpAndFade;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
&[data-
|
|
49
|
+
&[data-open][data-side="left"] {
|
|
49
50
|
animation-name: slideRightAndFade;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -204,4 +205,4 @@
|
|
|
204
205
|
transform: translateX(0);
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
}
|
|
208
|
+
}
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
box-shadow: var(--shadow-md);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-
|
|
32
|
+
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-open][data-side="top"] {
|
|
33
33
|
animation-name: slideDownAndFade-dohHTE;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-
|
|
36
|
+
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-open][data-side="right"] {
|
|
37
37
|
animation-name: slideLeftAndFade-ugM6Hs;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-
|
|
40
|
+
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-open][data-side="bottom"] {
|
|
41
41
|
animation-name: slideUpAndFade-bAwQJS;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-
|
|
44
|
+
:is(.content-UK9iLF, .infonomic-datepicker-content)[data-open][data-side="left"] {
|
|
45
45
|
animation-name: slideRightAndFade-o0jl7q;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-wrapper.d.ts","sourceRoot":"","sources":["../../../src/widgets/drawer/drawer-wrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"drawer-wrapper.d.ts","sourceRoot":"","sources":["../../../src/widgets/drawer/drawer-wrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAMnD,MAAM,WAAW,kBAAmB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,WAAW,EACX,GAAG,IAAI,EACR,EAAE,kBAAkB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4BxC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import { useFocusTrap } from "@mantine/hooks";
|
|
5
4
|
import classnames from "classnames";
|
|
6
5
|
import { m } from "motion/react";
|
|
6
|
+
import { useFocusTrap } from "../../hooks/use-focus-trap/index.js";
|
|
7
7
|
import drawer_module from "./drawer.module.js";
|
|
8
8
|
function DrawerWrapper({ className, children, onEscapeKey, ...rest }) {
|
|
9
9
|
const focusTrapRef = useFocusTrap();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-wrapper.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-wrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"modal-wrapper.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-wrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAMnD,MAAM,WAAW,iBAAkB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,GAAG,IAAI,EACR,EAAE,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4BvC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import { useFocusTrap } from "@mantine/hooks";
|
|
5
4
|
import classnames from "classnames";
|
|
6
5
|
import { m } from "motion/react";
|
|
6
|
+
import { useFocusTrap } from "../../hooks/use-focus-trap/index.js";
|
|
7
7
|
import modal_module from "./modal.module.js";
|
|
8
8
|
function ModalWrapper({ children, onEscapeKey, ...rest }) {
|
|
9
9
|
const focusTrapRef = useFocusTrap();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@infonomic/uikit",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
|
|
8
8
|
"keywords": [
|
|
@@ -58,16 +58,12 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@radix-ui/react-icons": "^1.3.2",
|
|
63
|
-
"@radix-ui/react-slot": "^1.2.4",
|
|
61
|
+
"@base-ui/react": "^1.0.0",
|
|
64
62
|
"classnames": "^2.5.1",
|
|
65
63
|
"date-fns": "^4.1.0",
|
|
66
|
-
"material-ripple-effects": "^2.0.1",
|
|
67
64
|
"motion": "^12.38.0",
|
|
68
65
|
"npm-run-all": "^4.1.5",
|
|
69
66
|
"prism-react-renderer": "^2.4.1",
|
|
70
|
-
"radix-ui": "^1.4.3",
|
|
71
67
|
"react": "19.2.4",
|
|
72
68
|
"react-day-picker": "^9.14.0",
|
|
73
69
|
"react-dom": "19.2.4",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
+
|
|
4
5
|
.item,
|
|
5
6
|
:global(.infonomic-accordion-item) {
|
|
6
7
|
overflow: hidden;
|
|
@@ -25,11 +26,11 @@
|
|
|
25
26
|
:global(.infonomic-accordion-content) {
|
|
26
27
|
overflow: hidden;
|
|
27
28
|
|
|
28
|
-
&[data-
|
|
29
|
+
&[data-open] {
|
|
29
30
|
animation: accordionSlideDown 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
&[data-
|
|
33
|
+
&[data-ending-style] {
|
|
33
34
|
animation: accordionSlideUp 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -40,17 +41,17 @@
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
to {
|
|
43
|
-
height: var(--
|
|
44
|
+
height: var(--accordion-panel-height);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
@keyframes accordionSlideUp {
|
|
48
49
|
from {
|
|
49
|
-
height: var(--
|
|
50
|
+
height: var(--accordion-panel-height);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
to {
|
|
53
54
|
height: 0;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChevronDownIcon } from '@radix-ui/react-icons'
|
|
2
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
2
|
|
|
3
|
+
import { ChevronDownIcon } from '../../icons/chevron-down-icon.js'
|
|
4
4
|
import { Accordion as AccordionComponent } from './accordion.js'
|
|
5
5
|
|
|
6
6
|
const meta: Meta = {
|
|
@@ -24,10 +24,7 @@ type Story = StoryObj<typeof AccordionComponent.Root>
|
|
|
24
24
|
*/
|
|
25
25
|
export const Accordion: Story = {
|
|
26
26
|
args: {
|
|
27
|
-
|
|
28
|
-
asChild: true,
|
|
29
|
-
defaultValue: 'item-1',
|
|
30
|
-
collapsible: true,
|
|
27
|
+
defaultValue: ['item-1'],
|
|
31
28
|
className: 'accordion-root',
|
|
32
29
|
},
|
|
33
30
|
render: (args) => (
|
|
@@ -56,11 +53,11 @@ export const Accordion: Story = {
|
|
|
56
53
|
transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
.accordion-trigger[data-
|
|
56
|
+
.accordion-trigger[data-panel-open] ~ .accordion-chevron {
|
|
60
57
|
transform: rotate(180deg);
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
.accordion-
|
|
60
|
+
.accordion-panel {
|
|
64
61
|
padding: 0 12px;
|
|
65
62
|
}
|
|
66
63
|
|
|
@@ -85,9 +82,9 @@ export const Accordion: Story = {
|
|
|
85
82
|
</AccordionComponent.Trigger>
|
|
86
83
|
<ChevronDownIcon className="accordion-chevron" />
|
|
87
84
|
</AccordionComponent.Header>
|
|
88
|
-
<AccordionComponent.
|
|
85
|
+
<AccordionComponent.Panel className="accordion-panel">
|
|
89
86
|
<p>Yes. It adheres to the WAI-ARIA design pattern.</p>
|
|
90
|
-
</AccordionComponent.
|
|
87
|
+
</AccordionComponent.Panel>
|
|
91
88
|
</AccordionComponent.Item>
|
|
92
89
|
|
|
93
90
|
<AccordionComponent.Item value="item-2">
|
|
@@ -97,13 +94,13 @@ export const Accordion: Story = {
|
|
|
97
94
|
</AccordionComponent.Trigger>
|
|
98
95
|
<ChevronDownIcon className="accordion-chevron" />
|
|
99
96
|
</AccordionComponent.Header>
|
|
100
|
-
<AccordionComponent.
|
|
97
|
+
<AccordionComponent.Panel className="accordion-panel">
|
|
101
98
|
<ul>
|
|
102
99
|
<li>Submenu Item One</li>
|
|
103
100
|
<li>Submenu Item Two</li>
|
|
104
101
|
<li>Submenu Item Three</li>
|
|
105
102
|
</ul>
|
|
106
|
-
</AccordionComponent.
|
|
103
|
+
</AccordionComponent.Panel>
|
|
107
104
|
</AccordionComponent.Item>
|
|
108
105
|
|
|
109
106
|
<AccordionComponent.Item value="item-3">
|
|
@@ -113,9 +110,9 @@ export const Accordion: Story = {
|
|
|
113
110
|
</AccordionComponent.Trigger>
|
|
114
111
|
<ChevronDownIcon className="accordion-chevron" />
|
|
115
112
|
</AccordionComponent.Header>
|
|
116
|
-
<AccordionComponent.
|
|
113
|
+
<AccordionComponent.Panel className="accordion-panel">
|
|
117
114
|
<p> Yes! You can animate the Accordion with CSS or JavaScript.</p>
|
|
118
|
-
</AccordionComponent.
|
|
115
|
+
</AccordionComponent.Panel>
|
|
119
116
|
</AccordionComponent.Item>
|
|
120
117
|
</nav>
|
|
121
118
|
</AccordionComponent.Root>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
import type React from 'react'
|
|
10
10
|
|
|
11
|
+
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'
|
|
11
12
|
import cx from 'classnames'
|
|
12
|
-
import { Accordion as AccordionPrimitive } from 'radix-ui'
|
|
13
13
|
|
|
14
14
|
import styles from './accordion.module.css'
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ const Root = ({
|
|
|
24
24
|
children: React.ReactNode
|
|
25
25
|
className?: string
|
|
26
26
|
ref?: React.RefObject<AccordionRootElement>
|
|
27
|
-
} &
|
|
27
|
+
} & React.ComponentProps<typeof AccordionPrimitive.Root>) => {
|
|
28
28
|
return (
|
|
29
29
|
<AccordionPrimitive.Root
|
|
30
30
|
ref={ref}
|
|
@@ -42,7 +42,7 @@ const Item = function AccordionItem({
|
|
|
42
42
|
children,
|
|
43
43
|
className,
|
|
44
44
|
...props
|
|
45
|
-
}: AccordionPrimitive.
|
|
45
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item> & {
|
|
46
46
|
ref?: React.RefObject<AccordionItemElement>
|
|
47
47
|
}) {
|
|
48
48
|
return (
|
|
@@ -56,13 +56,13 @@ const Item = function AccordionItem({
|
|
|
56
56
|
)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export type AccordionHeaderElement = React.ComponentRef<'
|
|
59
|
+
export type AccordionHeaderElement = React.ComponentRef<'h3'>
|
|
60
60
|
const Header = function AccordionHeader({
|
|
61
61
|
ref,
|
|
62
62
|
children,
|
|
63
63
|
className,
|
|
64
64
|
...props
|
|
65
|
-
}: AccordionPrimitive.
|
|
65
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Header> & {
|
|
66
66
|
ref?: React.RefObject<AccordionHeaderElement>
|
|
67
67
|
}) {
|
|
68
68
|
return (
|
|
@@ -82,7 +82,7 @@ const Trigger = function AccordionTrigger({
|
|
|
82
82
|
children,
|
|
83
83
|
className,
|
|
84
84
|
...props
|
|
85
|
-
}: AccordionPrimitive.
|
|
85
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger> & {
|
|
86
86
|
ref?: React.RefObject<AccordionTriggerElement>
|
|
87
87
|
}) {
|
|
88
88
|
return (
|
|
@@ -96,23 +96,23 @@ const Trigger = function AccordionTrigger({
|
|
|
96
96
|
)
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export type
|
|
100
|
-
const
|
|
99
|
+
export type AccordionPanelElement = React.ComponentRef<'div'>
|
|
100
|
+
const Panel = function AccordionPanel({
|
|
101
101
|
ref,
|
|
102
102
|
children,
|
|
103
103
|
className,
|
|
104
104
|
...props
|
|
105
|
-
}: AccordionPrimitive.
|
|
106
|
-
ref?: React.RefObject<
|
|
105
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Panel> & {
|
|
106
|
+
ref?: React.RefObject<AccordionPanelElement>
|
|
107
107
|
}) {
|
|
108
108
|
return (
|
|
109
|
-
<AccordionPrimitive.
|
|
109
|
+
<AccordionPrimitive.Panel
|
|
110
110
|
className={cx('infonomic-accordion-content', styles.content, className)}
|
|
111
111
|
{...props}
|
|
112
112
|
ref={ref}
|
|
113
113
|
>
|
|
114
114
|
{children}
|
|
115
|
-
</AccordionPrimitive.
|
|
115
|
+
</AccordionPrimitive.Panel>
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -121,5 +121,5 @@ export const Accordion = {
|
|
|
121
121
|
Item,
|
|
122
122
|
Header,
|
|
123
123
|
Trigger,
|
|
124
|
-
|
|
124
|
+
Panel,
|
|
125
125
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import type React from 'react'
|
|
4
4
|
|
|
5
|
+
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'
|
|
5
6
|
import cx from 'classnames'
|
|
6
|
-
import { Avatar as AvatarPrimitive } from 'radix-ui'
|
|
7
7
|
|
|
8
8
|
import styles from './avatar.module.css'
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ export const Avatar = ({ initials }: { initials: string }): React.JSX.Element =>
|
|
|
19
19
|
/>
|
|
20
20
|
<AvatarPrimitive.Fallback
|
|
21
21
|
className={cx('infonomic-avatar-fallback', styles['avatar-fallback'])}
|
|
22
|
-
|
|
22
|
+
delay={600}
|
|
23
23
|
>
|
|
24
24
|
<span className={cx('infonomic-avatar-text', styles['avatar-text'])}>{initials}</span>
|
|
25
25
|
</AvatarPrimitive.Fallback>
|