@g4rcez/components 5.0.2 → 5.0.3
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/dist/AnimatePresence-j36AYeOQ.js +181 -0
- package/dist/AnimatePresence-j36AYeOQ.js.map +1 -0
- package/dist/Calendar.es-xICmgvjq.js +23 -0
- package/dist/Calendar.es-xICmgvjq.js.map +1 -0
- package/dist/Funnel.es-DjKVl8Nj.js +23 -0
- package/dist/Funnel.es-DjKVl8Nj.js.map +1 -0
- package/dist/{MotionConfig-DKKYqBH2.js → MotionConfig-CXHoPGbK.js} +2 -2
- package/dist/{MotionConfig-DKKYqBH2.js.map → MotionConfig-CXHoPGbK.js.map} +1 -1
- package/dist/Plus.es-DbyRkEE2.js +23 -0
- package/dist/Plus.es-DbyRkEE2.js.map +1 -0
- package/dist/Trash.es-BFAc8PMf.js +23 -0
- package/dist/Trash.es-BFAc8PMf.js.map +1 -0
- package/dist/{calendar-PCCZDUIL.js → calendar-DEPkz8sw.js} +364 -502
- package/dist/calendar-DEPkz8sw.js.map +1 -0
- package/dist/calendar-header-Dfr-CwkY.js +174 -0
- package/dist/calendar-header-Dfr-CwkY.js.map +1 -0
- package/dist/chunk-jwUa06l-.js +23 -0
- package/dist/components/core/button.js +1 -1
- package/dist/components/core/heading.js +11 -0
- package/dist/components/core/heading.js.map +1 -0
- package/dist/{polymorph-BLXhrn9n.js → components/core/polymorph.js} +2 -2
- package/dist/components/core/polymorph.js.map +1 -0
- package/dist/components/core/render-on-view.js +29 -0
- package/dist/components/core/render-on-view.js.map +1 -0
- package/dist/components/core/resizable.d.ts +7 -1
- package/dist/components/core/resizable.d.ts.map +1 -1
- package/dist/components/core/resizable.js +60 -0
- package/dist/components/core/resizable.js.map +1 -0
- package/dist/components/core/resizable.jsx +46 -40
- package/dist/{slot-pC8kH9De.js → components/core/slot.js} +2 -2
- package/dist/components/core/slot.js.map +1 -0
- package/dist/components/core/tag.js +1 -1
- package/dist/components/core/typography.js +40 -0
- package/dist/components/core/typography.js.map +1 -0
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/alert.js +83 -102
- package/dist/components/display/alert.js.map +1 -1
- package/dist/components/display/alert.jsx +26 -29
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/calendar.js +1 -1
- package/dist/components/display/calendar.jsx +15 -10
- package/dist/components/display/card.js +2 -2
- package/dist/components/display/empty.d.ts.map +1 -1
- package/dist/components/display/empty.js +25 -0
- package/dist/components/display/empty.js.map +1 -0
- package/dist/components/display/empty.jsx +3 -1
- package/dist/components/display/list.d.ts.map +1 -1
- package/dist/components/display/list.js +132 -122
- package/dist/components/display/list.js.map +1 -1
- package/dist/components/display/list.jsx +30 -25
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/notifications.js +1 -1
- package/dist/components/display/notifications.jsx +8 -6
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/progress.js +3 -0
- package/dist/components/display/progress.jsx +6 -8
- package/dist/components/display/shortcut.js +2 -0
- package/dist/components/display/skeleton.js +41 -0
- package/dist/components/display/skeleton.js.map +1 -0
- package/dist/components/display/spinner.js +17 -0
- package/dist/components/display/spinner.js.map +1 -0
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/step.js +3 -0
- package/dist/components/display/step.jsx +5 -5
- package/dist/components/display/tabs.js +1 -1
- package/dist/components/display/timeline.js +1 -1
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.js +255 -0
- package/dist/components/floating/command-palette.js.map +1 -0
- package/dist/components/floating/command-palette.jsx +34 -25
- package/dist/components/floating/dropdown.js +1 -1
- package/dist/components/floating/dropdown.js.map +1 -1
- package/dist/components/floating/dropdown.jsx +1 -1
- package/dist/components/floating/expand.js +15 -14
- package/dist/components/floating/expand.js.map +1 -1
- package/dist/components/floating/menu.js +1 -1
- package/dist/components/floating/modal.d.ts +14 -11
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.js +1 -1
- package/dist/components/floating/modal.jsx +56 -17
- package/dist/components/floating/toolbar.d.ts +3 -3
- package/dist/components/floating/toolbar.d.ts.map +1 -1
- package/dist/components/floating/toolbar.js +20 -0
- package/dist/components/floating/toolbar.js.map +1 -0
- package/dist/components/floating/toolbar.jsx +7 -3
- package/dist/components/floating/tooltip.js +2 -2
- package/dist/components/floating/tooltip.js.map +1 -1
- package/dist/components/floating/tooltip.jsx +1 -1
- package/dist/components/floating/wizard.js +3 -0
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/autocomplete.js +344 -2
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/autocomplete.jsx +27 -18
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +29 -27
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/checkbox.jsx +21 -6
- package/dist/components/form/date-picker.js +1 -1
- package/dist/components/form/date-picker.jsx +1 -1
- package/dist/components/form/file-upload.d.ts +6 -1
- package/dist/components/form/file-upload.d.ts.map +1 -1
- package/dist/components/form/file-upload.js +1 -1
- package/dist/components/form/file-upload.jsx +34 -12
- package/dist/components/form/formReset.js +10 -0
- package/dist/components/form/formReset.js.map +1 -0
- package/dist/components/form/free-text.js +70 -0
- package/dist/components/form/free-text.js.map +1 -0
- package/dist/components/form/free-text.jsx +1 -1
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.js +3 -0
- package/dist/components/form/input-field.jsx +14 -8
- package/dist/components/form/input.js +1 -1
- package/dist/components/form/multi-select.d.ts.map +1 -1
- package/dist/components/form/multi-select.js +420 -0
- package/dist/components/form/multi-select.js.map +1 -0
- package/dist/components/form/multi-select.jsx +41 -33
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/select.js +55 -51
- package/dist/components/form/select.js.map +1 -1
- package/dist/components/form/select.jsx +8 -5
- package/dist/components/form/slider.js +3 -0
- package/dist/components/form/switch.d.ts +2 -1
- package/dist/components/form/switch.d.ts.map +1 -1
- package/dist/components/form/switch.js +32 -26
- package/dist/components/form/switch.js.map +1 -1
- package/dist/components/form/switch.jsx +26 -13
- package/dist/components/form/textarea.js +19 -0
- package/dist/components/form/textarea.js.map +1 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -1
- package/dist/components/page-calendar/calendar-header.js +2 -0
- package/dist/components/page-calendar/calendar-header.jsx +6 -4
- package/dist/components/page-calendar/day-view.js +124 -0
- package/dist/components/page-calendar/day-view.js.map +1 -0
- package/dist/components/page-calendar/event-pill.js +44 -0
- package/dist/components/page-calendar/event-pill.js.map +1 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -1
- package/dist/components/page-calendar/month-view.js +109 -0
- package/dist/components/page-calendar/month-view.js.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +78 -31
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -1
- package/dist/components/page-calendar/page-calendar.js +75 -0
- package/dist/components/page-calendar/page-calendar.js.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +2 -2
- package/dist/components/page-calendar/week-view.js +88 -0
- package/dist/components/page-calendar/week-view.js.map +1 -0
- package/dist/components/table/filter.d.ts.map +1 -1
- package/dist/components/table/filter.js +239 -0
- package/dist/components/table/filter.js.map +1 -0
- package/dist/components/table/filter.jsx +9 -4
- package/dist/components/table/group.d.ts.map +1 -1
- package/dist/components/table/group.js +3 -0
- package/dist/components/table/group.jsx +5 -3
- package/dist/components/table/index.js +102 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/inner-table.js +2 -0
- package/dist/components/table/inner-table.jsx +1 -1
- package/dist/components/table/metadata.js +73 -0
- package/dist/components/table/metadata.js.map +1 -0
- package/dist/components/table/metadata.jsx +1 -1
- package/dist/components/table/pagination.js +70 -0
- package/dist/components/table/pagination.js.map +1 -0
- package/dist/components/table/row.js +58 -0
- package/dist/components/table/row.js.map +1 -0
- package/dist/components/table/sort.d.ts.map +1 -1
- package/dist/components/table/sort.js +3 -0
- package/dist/components/table/sort.jsx +3 -1
- package/dist/components/table/thead.js +3 -0
- package/dist/config/default-translations.d.ts +18 -0
- package/dist/config/default-translations.d.ts.map +1 -1
- package/dist/config/default-translations.jsx +18 -0
- package/dist/{use-translations-DTLfPE3_.js → context-CsnUsfeP.js} +55 -40
- package/dist/context-CsnUsfeP.js.map +1 -0
- package/dist/{date-picker-BhKEFZew.js → date-picker-DNzupG8R.js} +301 -317
- package/dist/date-picker-DNzupG8R.js.map +1 -0
- package/dist/dict-CisoYSMO.js +28 -0
- package/dist/dict-CisoYSMO.js.map +1 -0
- package/dist/dist-ChfJ5LO9.js +498 -0
- package/dist/dist-ChfJ5LO9.js.map +1 -0
- package/dist/{dist-BrGpYRaj.js → dist-DIjUECx9.js} +56 -56
- package/dist/{dist-BrGpYRaj.js.map → dist-DIjUECx9.js.map} +1 -1
- package/dist/dom-Bn4wY_Zx.js.map +1 -1
- package/dist/{file-upload-DWbZfeG5.js → file-upload-C2zNnv9n.js} +501 -481
- package/dist/{file-upload-DWbZfeG5.js.map → file-upload-C2zNnv9n.js.map} +1 -1
- package/dist/fzf-CPGDDCoU.js +64 -0
- package/dist/fzf-CPGDDCoU.js.map +1 -0
- package/dist/getISOWeek-EcB4Ebqp.js +72 -0
- package/dist/getISOWeek-EcB4Ebqp.js.map +1 -0
- package/dist/group-Dl14TJXO.js +222 -0
- package/dist/group-Dl14TJXO.js.map +1 -0
- package/dist/hooks/use-translations.d.ts +18 -0
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inner-table-CeDX60cL.js +151 -0
- package/dist/inner-table-CeDX60cL.js.map +1 -0
- package/dist/input-Cmyuea4Y.js +412 -0
- package/dist/input-Cmyuea4Y.js.map +1 -0
- package/dist/{input-field-B_whI66Q.js → input-field-ffx1MbHo.js} +29 -16
- package/dist/input-field-ffx1MbHo.js.map +1 -0
- package/dist/isSameMonth-C3lsSwcg.js +10 -0
- package/dist/isSameMonth-C3lsSwcg.js.map +1 -0
- package/dist/isToday-COXfxFui.js +32 -0
- package/dist/isToday-COXfxFui.js.map +1 -0
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/modal-Df8-6i-o.js +408 -0
- package/dist/modal-Df8-6i-o.js.map +1 -0
- package/dist/notifications-NhCESJUV.js +1697 -0
- package/dist/notifications-NhCESJUV.js.map +1 -0
- package/dist/page-calendar.utils-Bd0PHktL.js +102 -0
- package/dist/page-calendar.utils-Bd0PHktL.js.map +1 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +6 -7
- package/dist/preset/src/styles/dark.js +1 -1
- package/dist/progress-8LO5gWLp.js +104 -0
- package/dist/progress-8LO5gWLp.js.map +1 -0
- package/dist/{proxy-BcJ_5Dwq.js → proxy-fP2NxmhM.js} +658 -844
- package/dist/proxy-fP2NxmhM.js.map +1 -0
- package/dist/shim-Czv-YhKR.js +93 -0
- package/dist/shim-Czv-YhKR.js.map +1 -0
- package/dist/shortcut-CQCmgmlU.js +100 -0
- package/dist/shortcut-CQCmgmlU.js.map +1 -0
- package/dist/slider-TX9hiHO-.js +1196 -0
- package/dist/slider-TX9hiHO-.js.map +1 -0
- package/dist/sort-DGmiselV.js +195 -0
- package/dist/sort-DGmiselV.js.map +1 -0
- package/dist/step-DFpJ7zCG.js +185 -0
- package/dist/step-DFpJ7zCG.js.map +1 -0
- package/dist/styles/dark.js +1 -1
- package/dist/subMonths-QcCnE3Yh.js +43 -0
- package/dist/subMonths-QcCnE3Yh.js.map +1 -0
- package/dist/table-lib-1bkYSklk.js +174 -0
- package/dist/table-lib-1bkYSklk.js.map +1 -0
- package/dist/{tabs-Ciy0l9OF.js → tabs-Brc963EW.js} +2 -2
- package/dist/{tabs-Ciy0l9OF.js.map → tabs-Brc963EW.js.map} +1 -1
- package/dist/thead-B6WELJZ-.js +211 -0
- package/dist/thead-B6WELJZ-.js.map +1 -0
- package/dist/use-locale-DPM_sg4s.js +12 -0
- package/dist/use-locale-DPM_sg4s.js.map +1 -0
- package/dist/use-remove-scroll-pAgC09Sq.js +38 -0
- package/dist/use-remove-scroll-pAgC09Sq.js.map +1 -0
- package/dist/use-translations-BE4PuhLm.js +11 -0
- package/dist/use-translations-BE4PuhLm.js.map +1 -0
- package/dist/useAnimationFrame-DnKbaXfi.js +223 -0
- package/dist/useAnimationFrame-DnKbaXfi.js.map +1 -0
- package/dist/valueToPercent-DZc_m1tm.js +43 -0
- package/dist/valueToPercent-DZc_m1tm.js.map +1 -0
- package/dist/visuallyHidden-B7wI86yi.js +303 -0
- package/dist/visuallyHidden-B7wI86yi.js.map +1 -0
- package/dist/with-selector-BFW5n-pb.js +102 -0
- package/dist/with-selector-BFW5n-pb.js.map +1 -0
- package/dist/wizard-7u_qZ-78.js +218 -0
- package/dist/wizard-7u_qZ-78.js.map +1 -0
- package/package.json +19 -11
- package/dist/autocomplete-D3VOTihi.js +0 -415
- package/dist/autocomplete-D3VOTihi.js.map +0 -1
- package/dist/calendar-PCCZDUIL.js.map +0 -1
- package/dist/components/table/table.js +0 -3
- package/dist/date-picker-BhKEFZew.js.map +0 -1
- package/dist/input-B7jqwPG4.js +0 -473
- package/dist/input-B7jqwPG4.js.map +0 -1
- package/dist/input-field-B_whI66Q.js.map +0 -1
- package/dist/modal-Bz-61ays.js +0 -373
- package/dist/modal-Bz-61ays.js.map +0 -1
- package/dist/notifications-MT4XkLov.js +0 -2203
- package/dist/notifications-MT4XkLov.js.map +0 -1
- package/dist/polymorph-BLXhrn9n.js.map +0 -1
- package/dist/proxy-BcJ_5Dwq.js.map +0 -1
- package/dist/skeleton-CBYEq3lM.js +0 -26
- package/dist/skeleton-CBYEq3lM.js.map +0 -1
- package/dist/slot-pC8kH9De.js.map +0 -1
- package/dist/table-CUFbAI2k.js +0 -1914
- package/dist/table-CUFbAI2k.js.map +0 -1
- package/dist/use-translations-DTLfPE3_.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-header-Dfr-CwkY.js","names":["s","t"],"sources":["../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@phosphor-icons/react/dist/defs/PlusCircle.es.js","../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@phosphor-icons/react/dist/csr/PlusCircle.es.js","../../../node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/addWeeks.js","../../../node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/subWeeks.js","../src/components/page-calendar/calendar-header.tsx"],"sourcesContent":["import * as e from \"react\";\nconst a = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z\", opacity: \"0.2\" }), /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z\" }))\n ]\n]);\nexport {\n a as default\n};\n","import * as e from \"react\";\nimport s from \"../lib/IconBase.es.js\";\nimport t from \"../defs/PlusCircle.es.js\";\nconst o = e.forwardRef((r, c) => /* @__PURE__ */ e.createElement(s, { ref: c, ...r, weights: t }));\no.displayName = \"PlusCircleIcon\";\nconst l = o;\nexport {\n l as PlusCircle,\n o as PlusCircleIcon\n};\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { addWeeks } from \"./addWeeks.js\";\n\n/**\n * The {@link subWeeks} function options.\n */\n\n/**\n * @name subWeeks\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the weeks subtracted\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * const result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\nexport function subWeeks(date, amount, options) {\n return addWeeks(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subWeeks;\n","import { Button } from \"../core/button\";\nimport { Tag } from \"../core/tag\";\nimport { useLocale } from \"../../hooks/use-locale\";\nimport { useTranslations } from \"../../hooks/use-translations\";\nimport { CaretLeftIcon, CaretRightIcon, PlusCircleIcon, CalendarIcon } from \"@phosphor-icons/react\";\nimport { addDays, addMonths, addWeeks, isToday, subDays, subMonths, subWeeks } from \"date-fns\";\nimport type { CalendarFilter, ViewMode } from \"./page-calendar.types\";\nimport { formatDay, formatMonthShort, formatMonthYear, getWeekNumber } from \"./page-calendar.utils\";\nimport type { SetState } from \"../../types\";\nimport { useMemo, type ReactNode } from \"react\";\n\ntype CalendarHeaderProps = {\n currentDate: Date;\n currentView: ViewMode;\n onAddEvent?: () => void;\n filters: CalendarFilter[];\n filterArea?: ReactNode;\n setCurrentDate: SetState<Date>;\n setCurrentView: SetState<ViewMode>;\n onToggleFilter: (id: string) => void;\n};\n\nexport function CalendarHeader({\n currentDate,\n currentView,\n filters,\n filterArea,\n setCurrentDate,\n setCurrentView,\n onToggleFilter,\n onAddEvent,\n}: CalendarHeaderProps) {\n const locale = useLocale();\n const t = useTranslations();\n const isDateToday = isToday(currentDate);\n\n const VIEWS = useMemo(\n () => [\n { value: \"month\" as ViewMode, label: t.pageCalendarMonthView },\n { value: \"week\" as ViewMode, label: t.pageCalendarWeekView },\n { value: \"day\" as ViewMode, label: t.pageCalendarDayView },\n ],\n [t]\n );\n\n const handlePrev = () => {\n setCurrentDate((currentDate) => {\n if (currentView === \"month\") return subMonths(currentDate, 1);\n if (currentView === \"week\") return subWeeks(currentDate, 1);\n return subDays(currentDate, 1);\n });\n };\n\n const handleNext = () => {\n setCurrentDate((currentDate) => {\n if (currentView === \"month\") return addMonths(currentDate, 1);\n if (currentView === \"week\") return addWeeks(currentDate, 1);\n return addDays(currentDate, 1);\n });\n };\n\n const weekNum = getWeekNumber(currentDate);\n\n return (\n <header className=\"flex flex-col gap-page-calendar-header-gap\">\n <div className=\"flex items-center justify-between gap-page-calendar-header-gap\">\n <div className=\"flex items-center gap-page-calendar-date-gap\">\n <div\n aria-hidden=\"true\"\n className={`flex size-page-calendar-badge-size flex-col items-center justify-center overflow-hidden rounded-page-calendar-badge-radius text-page-calendar-week-label-text ${isDateToday ? \"bg-primary text-primary-foreground\" : \"bg-card text-foreground\"}`}\n >\n <span className=\"font-light uppercase leading-none\">{formatMonthShort(currentDate, locale)}</span>\n <span className=\"text-page-calendar-title-text font-medium leading-none\">{formatDay(currentDate, locale)}</span>\n </div>\n <div>\n <h1 aria-live=\"polite\" aria-atomic=\"true\" className=\"text-page-calendar-title-text font-bold leading-tight\">\n {formatMonthYear(currentDate, locale)}\n </h1>\n <span className=\"text-page-calendar-week-label-text text-muted-foreground\">{t.pageCalendarWeekLabel(weekNum)}</span>\n </div>\n </div>\n <nav aria-label={t.pageCalendarNavigation} className=\"flex items-center gap-page-calendar-nav-gap\">\n <div className=\"flex items-center gap-page-calendar-nav-btn-gap\">\n <Button\n size=\"small\"\n title={t.pageCalendarPrevious}\n aria-label={t.pageCalendarPrevious}\n theme=\"ghost-muted\"\n onClick={handlePrev}\n >\n <CaretLeftIcon size={16} />\n </Button>\n <button\n type=\"button\"\n aria-label={t.pageCalendarToday}\n onClick={() => setCurrentDate(new Date())}\n className=\"rounded-page-calendar-today-radius px-page-calendar-today-px py-page-calendar-today-py text-page-calendar-today-text transition-colors hover:bg-muted/50\"\n >\n {t.pageCalendarToday}\n </button>\n <Button size=\"small\" title={t.pageCalendarNext} aria-label={t.pageCalendarNext} theme=\"ghost-muted\" onClick={handleNext}>\n <CaretRightIcon size={16} />\n </Button>\n </div>\n <div className=\"flex rounded-page-calendar-view-switch-radius\">\n {VIEWS.map((v) => (\n <Button\n size=\"small\"\n key={v.value}\n rounded=\"squared\"\n onClick={() => setCurrentView(v.value)}\n theme={currentView === v.value ? \"primary\" : \"muted\"}\n aria-pressed={currentView === v.value}\n className=\"first:rounded-l-button-radius last:rounded-r-button-radius\"\n >\n {v.label}\n </Button>\n ))}\n </div>\n {onAddEvent && (\n <Button theme=\"primary\" size=\"small\" onClick={onAddEvent}>\n <PlusCircleIcon size={14} />\n {t.pageCalendarAddEvent}\n </Button>\n )}\n </nav>\n </div>\n {filterArea ??\n (filters.length > 0 && (\n <div role=\"group\" aria-label={t.pageCalendarFilter} className=\"flex flex-wrap items-center gap-page-calendar-filter-gap\">\n <span className=\"text-muted-foreground\">\n <CalendarIcon size={14} aria-hidden=\"true\" />\n </span>\n <span className=\"mr-page-calendar-nav-mr text-page-calendar-filter-text text-muted-foreground\">{t.pageCalendarFilter}</span>\n {filters.map((filter) => (\n <Tag\n as=\"button\"\n size=\"small\"\n type=\"button\"\n key={filter.id}\n theme={filter.theme}\n indicator={filter.enabled ? filter.theme : undefined}\n aria-pressed={filter.enabled}\n aria-label={`${filter.label}, ${filter.enabled ? t.pageCalendarFilterEnabled : t.pageCalendarFilterDisabled}`}\n onClick={() => onToggleFilter(filter.id)}\n >\n {filter.label}\n </Tag>\n ))}\n </div>\n ))}\n </header>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;AACA,IAAM,oBAAoB,IAAI,IAAI;CAChC,CACE,QACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,yOAAyO,CAAC,CAAC,CAC5U;CACA,CACE,WACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ;EAAE,GAAG;EAAmD,SAAS;CAAM,CAAC,GAAmB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CACjb;CACA,CACE,QACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,0JAA0J,CAAC,CAAC,CAC7P;CACA,CACE,SACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CAC9T;CACA,CACE,WACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CAC9T;CACA,CACE,QACgB,kBAAE,cAA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AC1B,EAAE,oBACC;;IAEX;KACJ;MACJ,MACI,EAAQ,SAAS,KACd,kBAAC,OAAD;GAAK,MAAK;GAAQ,cAAY,EAAE;GAAoB,WAAU;aAA9D;IACI,kBAAC,QAAD;KAAM,WAAU;eACZ,kBAAC,GAAD;MAAc,MAAM;MAAI,eAAY;KAAQ,CAAA;IAC1C,CAAA;IACN,kBAAC,QAAD;KAAM,WAAU;eAAgF,EAAE;IAAyB,CAAA;IAC1H,EAAQ,KAAK,MACV,kBAAC,GAAD;KACI,IAAG;KACH,MAAK;KACL,MAAK;KAEL,OAAO,EAAO;KACd,WAAW,EAAO,UAAU,EAAO,QAAQ,KAAA;KAC3C,gBAAc,EAAO;KACrB,cAAY,GAAG,EAAO,MAAM,IAAI,EAAO,UAAU,EAAE,4BAA4B,EAAE;KACjF,eAAe,EAAe,EAAO,EAAE;eAEtC,EAAO;IACP,GARI,EAAO,EAQX,CACR;GACA;KAET;;AAEhB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (e && (t = e(e = 0)), t), s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, l = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, u = (n, r, a) => (a = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { d as a, f as i, o as n, u as o, c as r, s as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../dom-Bn4wY_Zx.js";
|
|
2
2
|
import { t } from "../../dist-NmFtbuK4.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Polymorph as n } from "./polymorph.js";
|
|
4
4
|
import { forwardRef as r } from "react";
|
|
5
5
|
import { jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/core/button.tsx
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Polymorph as e } from "./polymorph.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/core/heading.tsx
|
|
4
|
+
var n = (n) => /* @__PURE__ */ t(e, {
|
|
5
|
+
as: "h2",
|
|
6
|
+
children: n.children
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as Heading };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/core/heading.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\nimport { Polymorph } from \"./polymorph\";\n\nexport const Heading = (props: PropsWithChildren) => {\n return <Polymorph as=\"h2\">{props.children}</Polymorph>;\n};\n"],"mappings":";;;AAGA,IAAa,KAAW,MACb,kBAAC,GAAD;CAAW,IAAG;WAAM,EAAM;AAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorph.js","names":[],"sources":["../../../src/components/core/polymorph.tsx"],"sourcesContent":["import type React from \"react\";\nimport { forwardRef } from \"react\";\n\ntype PropsOf<T extends React.ElementType> = React.ComponentPropsWithoutRef<T>;\n\nexport type PolymorphicProps<Props, T extends React.ElementType> = Props & {\n as?: T;\n} & Omit<PropsOf<T>, keyof Props | \"as\" | \"ref\"> & {\n ref?: React.ComponentProps<T>[\"ref\"];\n };\n\nexport const Polymorph = forwardRef(function InnerPolymorph<P extends React.ElementType = \"div\">(props: PropsOf<P>, ref: React.ForwardedRef<P>) {\n const Element = props.as || \"span\";\n return <Element ref={ref} {...props} as={undefined} />;\n});\n"],"mappings":";;;AAWA,IAAa,IAAY,EAAW,SAA6D,GAAmB,GAA4B;CAE5I,OAAO,kBADS,EAAM,MAAM,QACrB;EAAc;EAAK,GAAI;EAAO,IAAI,KAAA;CAAY,CAAA;AACzD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../../use-stable-ref-D5LFCx0u.js";
|
|
3
|
+
import { useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/core/render-on-view.tsx
|
|
6
|
+
function a(e) {
|
|
7
|
+
let t = e.getBoundingClientRect();
|
|
8
|
+
return t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
9
|
+
}
|
|
10
|
+
var o = ({ children: o, ...s }) => {
|
|
11
|
+
let c = e(s.onIntersection), l = n(null), [u, d] = r(() => l.current === null ? !1 : a(l.current));
|
|
12
|
+
return t(() => {
|
|
13
|
+
let e = l.current;
|
|
14
|
+
if (e === null) return;
|
|
15
|
+
let t = new IntersectionObserver((e) => {
|
|
16
|
+
let t = e[0];
|
|
17
|
+
return t.isIntersecting && c.current?.(), d((e) => t.isIntersecting ? !0 : e);
|
|
18
|
+
});
|
|
19
|
+
return t.observe(e), () => t.disconnect();
|
|
20
|
+
}, [c]), /* @__PURE__ */ i("div", {
|
|
21
|
+
...s,
|
|
22
|
+
ref: l,
|
|
23
|
+
children: u ? o : null
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as RenderOnView };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=render-on-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-on-view.js","names":[],"sources":["../../../src/components/core/render-on-view.tsx"],"sourcesContent":["\"use client\";\nimport React, { PropsWithChildren, useLayoutEffect, useRef, useState } from \"react\";\nimport { useStableRef } from \"../../hooks/use-stable-ref\";\nimport { PolymorphicProps } from \"./polymorph\";\n\nexport type RenderOnViewProps<T extends React.ElementType = \"div\"> = PolymorphicProps<\n {\n onIntersection?: () => void;\n },\n T\n>;\n\nfunction isInViewport(el: HTMLElement): boolean {\n const rect = el.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */\n );\n}\n\nexport const RenderOnView = ({ children, ...props }: PropsWithChildren<RenderOnViewProps>) => {\n const onIntersect = useStableRef(props.onIntersection);\n const ref = useRef<HTMLDivElement>(null);\n const [shouldRender, setShouldRender] = useState(() => (ref.current === null ? false : isInViewport(ref.current)));\n\n useLayoutEffect(() => {\n const div = ref.current;\n if (div === null) return;\n const observer = new IntersectionObserver((args) => {\n const first = args[0];\n if (first.isIntersecting) onIntersect.current?.();\n return setShouldRender((prev) => (first.isIntersecting ? true : prev));\n });\n observer.observe(div);\n return () => observer.disconnect();\n }, [onIntersect]);\n\n return (\n <div {...props} ref={ref}>\n {shouldRender ? children : null}\n </div>\n );\n};\n"],"mappings":";;;;;AAYA,SAAS,EAAa,GAA0B;CAC5C,IAAM,IAAO,EAAG,sBAAsB;CACtC,OACI,EAAK,OAAO,KACZ,EAAK,QAAQ,KACb,EAAK,WAAW,OAAO,eAAe,SAAS,gBAAgB,iBAC/D,EAAK,UAAU,OAAO,cAAc,SAAS,gBAAgB;AAErE;AAEA,IAAa,KAAgB,EAAE,aAAU,GAAG,QAAkD;CAC1F,IAAM,IAAc,EAAa,EAAM,cAAc,GAC/C,IAAM,EAAuB,IAAI,GACjC,CAAC,GAAc,KAAmB,QAAgB,EAAI,YAAY,OAAO,KAAQ,EAAa,EAAI,OAAO,CAAE;CAcjH,OAZA,QAAsB;EAClB,IAAM,IAAM,EAAI;EAChB,IAAI,MAAQ,MAAM;EAClB,IAAM,IAAW,IAAI,sBAAsB,MAAS;GAChD,IAAM,IAAQ,EAAK;GAEnB,OADI,EAAM,kBAAgB,EAAY,UAAU,GACzC,GAAiB,MAAU,EAAM,iBAAiB,KAAO,CAAK;EACzE,CAAC;EAED,OADA,EAAS,QAAQ,CAAG,SACP,EAAS,WAAW;CACrC,GAAG,CAAC,CAAW,CAAC,GAGZ,kBAAC,OAAD;EAAK,GAAI;EAAY;YAChB,IAAe,IAAW;CAC1B,CAAA;AAEb"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
type Props = React.PropsWithChildren<{
|
|
3
|
+
open?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
destroyOnUnmount?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const Resizable: ({ children, open, className, destroyOnUnmount }: Props) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
3
9
|
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC,CAAC;AAUH,eAAO,MAAM,SAAS,GAAI,iDAAgE,KAAK,6BA+C9F,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../../proxy-fP2NxmhM.js";
|
|
3
|
+
import { t } from "../../animate-BNYgkk_j.js";
|
|
4
|
+
import { t as n } from "../../use-motion-value-BqPF1j90.js";
|
|
5
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/core/resizable.tsx
|
|
8
|
+
var s = 600, c = {
|
|
9
|
+
type: "spring",
|
|
10
|
+
stiffness: 500,
|
|
11
|
+
damping: 50,
|
|
12
|
+
mass: .5
|
|
13
|
+
}, l = ({ children: l, open: u = !0, className: d, destroyOnUnmount: f = !1 }) => {
|
|
14
|
+
let [p, m] = a(null), [h, g] = a(!1), [_, v] = a(f ? u : !0), y = i(0), b = n(0);
|
|
15
|
+
return r(() => {
|
|
16
|
+
if (!f) return;
|
|
17
|
+
if (u) {
|
|
18
|
+
v(!0);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let e = setTimeout(() => v(!1), s);
|
|
22
|
+
return () => clearTimeout(e);
|
|
23
|
+
}, [u, f]), r(() => {
|
|
24
|
+
if (!p) return;
|
|
25
|
+
let e = new ResizeObserver((e) => {
|
|
26
|
+
let t = e[0];
|
|
27
|
+
if (!t) return;
|
|
28
|
+
let n = t.contentRect.height;
|
|
29
|
+
n <= 0 || (y.current = n, h || (b.jump(u ? n : 0), g(!0)));
|
|
30
|
+
});
|
|
31
|
+
return e.observe(p), () => e.disconnect();
|
|
32
|
+
}, [
|
|
33
|
+
p,
|
|
34
|
+
h,
|
|
35
|
+
u,
|
|
36
|
+
b
|
|
37
|
+
]), r(() => {
|
|
38
|
+
if (!h) return;
|
|
39
|
+
let e = t(b, u ? y.current : 0, c);
|
|
40
|
+
return () => e.stop();
|
|
41
|
+
}, [
|
|
42
|
+
u,
|
|
43
|
+
h,
|
|
44
|
+
b
|
|
45
|
+
]), _ ? /* @__PURE__ */ o(e.div, {
|
|
46
|
+
className: d,
|
|
47
|
+
style: {
|
|
48
|
+
height: h ? b : u ? "auto" : 0,
|
|
49
|
+
overflow: "hidden"
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ o("div", {
|
|
52
|
+
ref: m,
|
|
53
|
+
children: l
|
|
54
|
+
})
|
|
55
|
+
}) : null;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { l as Resizable };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=resizable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.js","names":[],"sources":["../../../src/components/core/resizable.tsx"],"sourcesContent":["\"use client\";\nimport { animate, motion, useMotionValue } from \"motion/react\";\nimport React, { useEffect, useRef, useState } from \"react\";\n\ntype Props = React.PropsWithChildren<{\n open?: boolean;\n className?: string;\n destroyOnUnmount?: boolean;\n}>;\n\nconst DESTROY_DELAY_MS = 600;\nconst SPRING = {\n type: \"spring\" as const,\n stiffness: 500,\n damping: 50,\n mass: 0.5,\n};\n\nexport const Resizable = ({ children, open = true, className, destroyOnUnmount = false }: Props) => {\n const [element, ref] = useState<HTMLDivElement | null>(null);\n const [ready, setReady] = useState(false);\n const [mounted, setMounted] = useState(destroyOnUnmount ? open : true);\n const measured = useRef(0);\n const height = useMotionValue<number>(0);\n\n useEffect(() => {\n if (!destroyOnUnmount) return;\n if (open) {\n setMounted(true);\n return;\n }\n const id = setTimeout(() => setMounted(false), DESTROY_DELAY_MS);\n return () => clearTimeout(id);\n }, [open, destroyOnUnmount]);\n\n useEffect(() => {\n if (!element) return;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const h = entry.contentRect.height;\n if (h <= 0) return;\n measured.current = h;\n if (!ready) {\n height.jump(open ? h : 0);\n setReady(true);\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [element, ready, open, height]);\n\n useEffect(() => {\n if (!ready) return;\n const controls = animate(height, open ? measured.current : 0, SPRING);\n return () => controls.stop();\n }, [open, ready, height]);\n\n if (!mounted) return null;\n\n return (\n <motion.div className={className} style={{ height: ready ? height : open ? \"auto\" : 0, overflow: \"hidden\" }}>\n <div ref={ref}>{children}</div>\n </motion.div>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAM,IAAmB,KACnB,IAAS;CACX,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACV,GAEa,KAAa,EAAE,aAAU,UAAO,IAAM,cAAW,sBAAmB,SAAmB;CAChG,IAAM,CAAC,GAAS,KAAO,EAAgC,IAAI,GACrD,CAAC,GAAO,KAAY,EAAS,EAAK,GAClC,CAAC,GAAS,KAAc,EAAS,IAAmB,IAAO,EAAI,GAC/D,IAAW,EAAO,CAAC,GACnB,IAAS,EAAuB,CAAC;CAqCvC,OAnCA,QAAgB;EACZ,IAAI,CAAC,GAAkB;EACvB,IAAI,GAAM;GACN,EAAW,EAAI;GACf;EACJ;EACA,IAAM,IAAK,iBAAiB,EAAW,EAAK,GAAG,CAAgB;EAC/D,aAAa,aAAa,CAAE;CAChC,GAAG,CAAC,GAAM,CAAgB,CAAC,GAE3B,QAAgB;EACZ,IAAI,CAAC,GAAS;EACd,IAAM,IAAW,IAAI,gBAAgB,MAAY;GAC7C,IAAM,IAAQ,EAAQ;GACtB,IAAI,CAAC,GAAO;GACZ,IAAM,IAAI,EAAM,YAAY;GACxB,KAAK,MACT,EAAS,UAAU,GACd,MACD,EAAO,KAAK,IAAO,IAAI,CAAC,GACxB,EAAS,EAAI;EAErB,CAAC;EAED,OADA,EAAS,QAAQ,CAAO,SACX,EAAS,WAAW;CACrC,GAAG;EAAC;EAAS;EAAO;EAAM;CAAM,CAAC,GAEjC,QAAgB;EACZ,IAAI,CAAC,GAAO;EACZ,IAAM,IAAW,EAAQ,GAAQ,IAAO,EAAS,UAAU,GAAG,CAAM;EACpE,aAAa,EAAS,KAAK;CAC/B,GAAG;EAAC;EAAM;EAAO;CAAM,CAAC,GAEnB,IAGD,kBAAC,EAAO,KAAR;EAAuB;EAAW,OAAO;GAAE,QAAQ,IAAQ,IAAS,IAAO,SAAS;GAAG,UAAU;EAAS;YACtG,kBAAC,OAAD;GAAU;GAAM;EAAc,CAAA;CACtB,CAAA,IALK;AAOzB"}
|
|
@@ -1,51 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { motion, useMotionValue } from "motion/react";
|
|
3
|
-
import React, { useEffect,
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
top: 0,
|
|
11
|
-
left: 0,
|
|
12
|
-
bottom: 0,
|
|
13
|
-
right: 0,
|
|
2
|
+
import { animate, motion, useMotionValue } from "motion/react";
|
|
3
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
4
|
+
const DESTROY_DELAY_MS = 600;
|
|
5
|
+
const SPRING = {
|
|
6
|
+
type: "spring",
|
|
7
|
+
stiffness: 500,
|
|
8
|
+
damping: 50,
|
|
9
|
+
mass: 0.5,
|
|
14
10
|
};
|
|
15
|
-
const
|
|
11
|
+
export const Resizable = ({ children, open = true, className, destroyOnUnmount = false }) => {
|
|
16
12
|
const [element, ref] = useState(null);
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (entries[0]) {
|
|
22
|
-
const rect = entries[0].contentRect;
|
|
23
|
-
motion.set({
|
|
24
|
-
x: rect.x,
|
|
25
|
-
y: rect.y,
|
|
26
|
-
width: rect.width,
|
|
27
|
-
height: rect.height,
|
|
28
|
-
top: rect.top,
|
|
29
|
-
left: rect.left,
|
|
30
|
-
bottom: rect.bottom,
|
|
31
|
-
right: rect.right,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}), [motion]);
|
|
13
|
+
const [ready, setReady] = useState(false);
|
|
14
|
+
const [mounted, setMounted] = useState(destroyOnUnmount ? open : true);
|
|
15
|
+
const measured = useRef(0);
|
|
16
|
+
const height = useMotionValue(0);
|
|
35
17
|
useEffect(() => {
|
|
36
|
-
if (!
|
|
18
|
+
if (!destroyOnUnmount)
|
|
19
|
+
return;
|
|
20
|
+
if (open) {
|
|
21
|
+
setMounted(true);
|
|
37
22
|
return;
|
|
38
|
-
|
|
23
|
+
}
|
|
24
|
+
const id = setTimeout(() => setMounted(false), DESTROY_DELAY_MS);
|
|
25
|
+
return () => clearTimeout(id);
|
|
26
|
+
}, [open, destroyOnUnmount]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!element)
|
|
39
29
|
return;
|
|
30
|
+
const observer = new ResizeObserver((entries) => {
|
|
31
|
+
const entry = entries[0];
|
|
32
|
+
if (!entry)
|
|
33
|
+
return;
|
|
34
|
+
const h = entry.contentRect.height;
|
|
35
|
+
if (h <= 0)
|
|
36
|
+
return;
|
|
37
|
+
measured.current = h;
|
|
38
|
+
if (!ready) {
|
|
39
|
+
height.jump(open ? h : 0);
|
|
40
|
+
setReady(true);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
40
43
|
observer.observe(element);
|
|
41
44
|
return () => observer.disconnect();
|
|
42
|
-
}, [element,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
}, [element, ready, open, height]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!ready)
|
|
48
|
+
return;
|
|
49
|
+
const controls = animate(height, open ? measured.current : 0, SPRING);
|
|
50
|
+
return () => controls.stop();
|
|
51
|
+
}, [open, ready, height]);
|
|
52
|
+
if (!mounted)
|
|
53
|
+
return null;
|
|
54
|
+
return (<motion.div className={className} style={{ height: ready ? height : open ? "auto" : 0, overflow: "hidden" }}>
|
|
49
55
|
<div ref={ref}>{children}</div>
|
|
50
56
|
</motion.div>);
|
|
51
57
|
};
|
|
@@ -91,6 +91,6 @@ function g(e) {
|
|
|
91
91
|
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
|
-
export { u as
|
|
94
|
+
export { u as Slot, l as createSlot, p as createSlottable };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=slot
|
|
96
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","names":[],"sources":["../../../src/components/core/slot.tsx"],"sourcesContent":["import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\nconst REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\n\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<unknown>>>;\n}\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\nconst use: typeof React.use | undefined = (React as unknown as Record<string, unknown>)[\" use \".trim().toString()] as typeof React.use | undefined;\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === \"object\" &&\n \"$$typeof\" in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n \"_payload\" in element &&\n isPromiseLike(element._payload)\n );\n}\n\nexport function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? (newElement.props as { children: React.ReactNode }).children : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement) ? React.cloneElement(newElement, undefined, newChildren) : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nexport const Slot = createSlot(\"Slot\");\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nfunction createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<HTMLElement, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\nconst SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\nexport function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable(\"Slottable\");\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\nfunction getElementRef(element: React.ReactElement) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as unknown as { ref?: React.Ref<unknown> }).ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as unknown as { ref?: React.Ref<unknown> }).ref;\n}\n"],"mappings":";;;AAIA,IAAM,IAAkB,OAAO,IAAI,YAAY;AAE/C,SAAS,EAAU,GAAqB,GAAU;CAC9C,IAAI,OAAO,KAAQ,YACf,OAAO,EAAI,CAAK;CACb,AAAI,KAAQ,SACf,EAAI,UAAU;AAEtB;AAEA,SAAS,EAAe,GAAG,GAA8C;CACrE,QAAQ,MAAS;EACb,IAAI,IAAa,IACX,IAAW,EAAK,KAAK,MAAQ;GAC/B,IAAM,IAAU,EAAO,GAAK,CAAI;GAIhC,OAHI,CAAC,KAAc,OAAO,KAAW,eACjC,IAAa,KAEV;EACX,CAAC;EACD,IAAI,GACA,aAAa;GACT,KAAK,IAAI,IAAI,GAAG,IAAI,EAAS,QAAQ,KAAK;IACtC,IAAM,IAAU,EAAS;IACzB,AAAI,OAAO,KAAW,aAClB,EAAQ,IAER,EAAO,EAAK,IAAI,IAAI;GAE5B;EACJ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AAEA,SAAS,EAAc,GAA6B;CAChD,IAAI,IAAS,OAAO,yBAAyB,EAAQ,OAAO,KAAK,GAAG,KAChE,IAAU,KAAU,oBAAoB,KAAU,EAAO;CAS7D,OARI,IACQ,EAAoD,OAEhE,IAAS,OAAO,yBAAyB,GAAS,KAAK,GAAG,KAC1D,IAAU,KAAU,oBAAoB,KAAU,EAAO,gBACrD,IACQ,EAAQ,MAAuC,MAEnD,EAAQ,MAAuC,OAAQ,EAAoD;AACvH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../dom-Bn4wY_Zx.js";
|
|
2
2
|
import { t } from "../../dist-NmFtbuK4.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Polymorph as n } from "./polymorph.js";
|
|
4
4
|
import { forwardRef as r } from "react";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/core/tag.tsx
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as e } from "../../dom-Bn4wY_Zx.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/core/typography.tsx
|
|
5
|
+
var r = (n) => /* @__PURE__ */ t("p", {
|
|
6
|
+
...n,
|
|
7
|
+
className: e("text-typography-base leading-snug", n.className)
|
|
8
|
+
}), i = (n) => /* @__PURE__ */ t("p", {
|
|
9
|
+
...n,
|
|
10
|
+
className: e("mb-kilo text-typography-sm text-secondary", n.className)
|
|
11
|
+
}), a = (r) => /* @__PURE__ */ n("div", {
|
|
12
|
+
className: e(`flex ${r.row ? "flex-row items-center" : "flex-col"} gap-info-gap`, r.className),
|
|
13
|
+
children: [/* @__PURE__ */ t("span", {
|
|
14
|
+
className: "text-info-label-text font-medium tracking-wide",
|
|
15
|
+
children: r.row ? `${r.label}:` : r.label
|
|
16
|
+
}), /* @__PURE__ */ t("span", {
|
|
17
|
+
className: e(r.disabled ? "text-disabled" : "", r.row ? "w-fit text-info-value-text" : "w-full text-info-secondary-text"),
|
|
18
|
+
children: r.children
|
|
19
|
+
})]
|
|
20
|
+
}), o = (e) => /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("h2", {
|
|
21
|
+
className: "typography text-typography-3xl font-bold tracking-wide",
|
|
22
|
+
children: e.title
|
|
23
|
+
}), /* @__PURE__ */ t("p", {
|
|
24
|
+
className: "typography text-secondary",
|
|
25
|
+
children: e.children
|
|
26
|
+
})] }), s = (r) => /* @__PURE__ */ n("header", {
|
|
27
|
+
...r.containerProps,
|
|
28
|
+
className: e("gap-mega flex min-w-full flex-row flex-wrap items-center justify-between", r.containerProps?.className),
|
|
29
|
+
children: [/* @__PURE__ */ t(o, {
|
|
30
|
+
title: r.title,
|
|
31
|
+
children: r.description
|
|
32
|
+
}), /* @__PURE__ */ t("div", {
|
|
33
|
+
className: "gap-kilo flex flex-wrap items-center",
|
|
34
|
+
children: r.children
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { i as Description, a as Info, s as PageHeader, o as PageTitle, r as Paragraph };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","names":[],"sources":["../../../src/components/core/typography.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React, { type ComponentProps } from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Label } from \"../../types\";\n\nexport const Paragraph = (props: ComponentProps<\"p\">) => <p {...props} className={css(\"text-typography-base leading-snug\", props.className)} />;\n\nexport const Description = (props: ComponentProps<\"p\">) => (\n <p {...props} className={css(\"mb-kilo text-typography-sm text-secondary\", props.className)} />\n);\n\nexport type InfoProps = {\n info?: Label;\n label: Label;\n row?: boolean;\n disabled?: Label;\n className?: string;\n infoDescription?: string;\n};\n\nexport const Info = (props: React.PropsWithChildren<InfoProps>) => (\n <div className={css(`flex ${props.row ? \"flex-row items-center\" : \"flex-col\"} gap-info-gap`, props.className)}>\n <span className=\"text-info-label-text font-medium tracking-wide\">{props.row ? `${props.label}:` : props.label}</span>\n <span className={css(props.disabled ? \"text-disabled\" : \"\", props.row ? \"w-fit text-info-value-text\" : \"w-full text-info-secondary-text\")}>\n {props.children}\n </span>\n </div>\n);\n\nexport const PageTitle = (props: PropsWithChildren<{ title: string }>) => (\n <div>\n <h2 className=\"typography text-typography-3xl font-bold tracking-wide\">{props.title}</h2>\n <p className=\"typography text-secondary\">{props.children}</p>\n </div>\n);\n\ntype PageHeaderProps = {\n title: string;\n description: Label;\n containerProps?: React.ComponentProps<\"header\">;\n};\n\nexport const PageHeader = (props: PropsWithChildren<PageHeaderProps>) => {\n return (\n <header\n {...props.containerProps}\n className={css(\"gap-mega flex min-w-full flex-row flex-wrap items-center justify-between\", props.containerProps?.className)}\n >\n <PageTitle title={props.title}>{props.description}</PageTitle>\n <div className=\"gap-kilo flex flex-wrap items-center\">{props.children}</div>\n </header>\n );\n};\n"],"mappings":";;;;AAKA,IAAa,KAAa,MAA+B,kBAAC,KAAD;CAAG,GAAI;CAAO,WAAW,EAAI,qCAAqC,EAAM,SAAS;AAAI,CAAA,GAEjI,KAAe,MACxB,kBAAC,KAAD;CAAG,GAAI;CAAO,WAAW,EAAI,6CAA6C,EAAM,SAAS;AAAI,CAAA,GAYpF,KAAQ,MACjB,kBAAC,OAAD;CAAK,WAAW,EAAI,QAAQ,EAAM,MAAM,0BAA0B,WAAW,gBAAgB,EAAM,SAAS;WAA5G,CACI,kBAAC,QAAD;EAAM,WAAU;YAAkD,EAAM,MAAM,GAAG,EAAM,MAAM,KAAK,EAAM;CAAY,CAAA,GACpH,kBAAC,QAAD;EAAM,WAAW,EAAI,EAAM,WAAW,kBAAkB,IAAI,EAAM,MAAM,+BAA+B,iCAAiC;YACnI,EAAM;CACL,CAAA,CACL;IAGI,KAAa,MACtB,kBAAC,OAAD,EAAA,UAAA,CACI,kBAAC,MAAD;CAAI,WAAU;WAA0D,EAAM;AAAU,CAAA,GACxF,kBAAC,KAAD;CAAG,WAAU;WAA6B,EAAM;AAAY,CAAA,CAC3D,EAAA,CAAA,GASI,KAAc,MAEnB,kBAAC,UAAD;CACI,GAAI,EAAM;CACV,WAAW,EAAI,4EAA4E,EAAM,gBAAgB,SAAS;WAF9H,CAII,kBAAC,GAAD;EAAW,OAAO,EAAM;YAAQ,EAAM;CAAuB,CAAA,GAC7D,kBAAC,OAAD;EAAK,WAAU;YAAwC,EAAM;CAAc,CAAA,CACvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAA2B,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAShE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,sBAc/D,CAAC;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;CAUlB,CAAC;AAOF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,WAAW,CAAC,OAAO,aAAa,CAAC,GAC7B,OAAO,CAAC;IACJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAoD9E,CAAC"}
|