@opengovsg/oui 0.0.0-snapshot-20251203100754 → 0.0.0-snapshot-20260126025301
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/cjs/accordion/accordion.cjs +189 -0
- package/dist/cjs/accordion/index.cjs +13 -0
- package/dist/cjs/avatar/avatar-context.cjs +12 -0
- package/dist/cjs/avatar/avatar-group-context.cjs +88 -0
- package/dist/cjs/avatar/avatar-group.cjs +60 -0
- package/dist/cjs/avatar/avatar.cjs +132 -0
- package/dist/cjs/avatar/hooks/use-img-loading-status.cjs +68 -0
- package/dist/cjs/avatar/index.cjs +23 -0
- package/dist/cjs/avatar/utils.cjs +9 -0
- package/dist/cjs/badge/badge.cjs +5 -5
- package/dist/cjs/badge/use-badge.cjs +6 -6
- package/dist/cjs/banner/banner.cjs +6 -6
- package/dist/cjs/button/button.cjs +15 -12
- package/dist/cjs/calendar/calendar-bottom-content.cjs +3 -3
- package/dist/cjs/calendar/calendar-header.cjs +4 -4
- package/dist/cjs/calendar/calendar-month-day-selector.cjs +2 -2
- package/dist/cjs/calendar/calendar.cjs +4 -4
- package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +4 -4
- package/dist/cjs/calendar/utils.cjs +3 -3
- package/dist/cjs/checkbox/checkbox.cjs +4 -4
- package/dist/cjs/combo-box/combo-box-fuzzy.cjs +6 -6
- package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
- package/dist/cjs/combo-box/combo-box.cjs +6 -6
- package/dist/cjs/date-field/date-field.cjs +3 -3
- package/dist/cjs/date-picker/date-picker.cjs +6 -5
- package/dist/cjs/date-range-picker/date-range-picker.cjs +5 -5
- package/dist/cjs/field/field.cjs +3 -3
- package/dist/cjs/file-dropzone/file-dropzone.cjs +22 -18
- package/dist/cjs/file-dropzone/file-info.cjs +7 -6
- package/dist/cjs/file-dropzone/utils.cjs +4 -4
- package/dist/cjs/govt-banner/govt-banner.cjs +7 -7
- package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
- package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
- package/dist/cjs/hooks/use-draggable.cjs +8 -8
- package/dist/cjs/hooks/use-scroll-position.cjs +53 -0
- package/dist/cjs/index.cjs +67 -20
- package/dist/cjs/input/input.cjs +2 -2
- package/dist/cjs/menu/menu.cjs +8 -8
- package/dist/cjs/modal/modal-body.cjs +2 -2
- package/dist/cjs/modal/modal-content.cjs +5 -5
- package/dist/cjs/modal/modal-footer.cjs +2 -2
- package/dist/cjs/modal/modal-header.cjs +2 -2
- package/dist/cjs/modal/modal.cjs +3 -3
- package/dist/cjs/navbar/index.cjs +25 -0
- package/dist/cjs/navbar/navbar-brand.cjs +28 -0
- package/dist/cjs/navbar/navbar-content.cjs +33 -0
- package/dist/cjs/navbar/navbar-context.cjs +14 -0
- package/dist/cjs/navbar/navbar-item.cjs +29 -0
- package/dist/cjs/navbar/navbar-menu/i18n.cjs +23 -0
- package/dist/cjs/navbar/navbar-menu/item.cjs +44 -0
- package/dist/cjs/navbar/navbar-menu/menu.cjs +62 -0
- package/dist/cjs/navbar/navbar-menu/toggle.cjs +95 -0
- package/dist/cjs/navbar/navbar.cjs +50 -0
- package/dist/cjs/navbar/use-navbar.cjs +126 -0
- package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/Overlay.cjs +55 -0
- package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/PortalProvider.cjs +23 -0
- package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs +208 -0
- package/dist/cjs/node_modules/.pnpm/@react-aria_ssr@3.9.10_react@19.2.3/node_modules/@react-aria/ssr/dist/SSRProvider.cjs +104 -0
- package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/Icon.cjs +4 -4
- package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +3 -3
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/user.cjs +22 -0
- package/dist/cjs/number-field/number-field.cjs +3 -3
- package/dist/cjs/pagination/hooks/use-pagination.cjs +7 -7
- package/dist/cjs/pagination/pagination.cjs +9 -9
- package/dist/cjs/pagination/use-pagination-item.cjs +3 -3
- package/dist/cjs/pagination/use-pagination.cjs +8 -8
- package/dist/cjs/range-calendar/range-calendar.cjs +7 -7
- package/dist/cjs/ripple/use-ripple.cjs +4 -4
- package/dist/cjs/select/select.cjs +90 -18
- package/dist/cjs/spinner/use-spinner.cjs +3 -3
- package/dist/cjs/system/react-utils/children.cjs +33 -0
- package/dist/cjs/system/react-utils/context.cjs +3 -3
- package/dist/cjs/system/react-utils/refs.cjs +3 -3
- package/dist/cjs/system/utils.cjs +2 -50
- package/dist/cjs/tabs/tabs.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-item.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-list.cjs +4 -4
- package/dist/cjs/tag-field/tag-field-root.cjs +14 -14
- package/dist/cjs/tag-field/tag-field-state-context.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-tag-list.cjs +4 -4
- package/dist/cjs/tag-field/tag-field-trigger.cjs +2 -2
- package/dist/cjs/tag-field/tag-field.cjs +3 -3
- package/dist/cjs/tag-field/use-tag-field-state.cjs +6 -6
- package/dist/cjs/tag-field/use-tag-field.cjs +4 -4
- package/dist/cjs/text-area/text-area.cjs +2 -2
- package/dist/cjs/toast/index.cjs +13 -0
- package/dist/cjs/toast/toast.cjs +91 -0
- package/dist/cjs/toggle/toggle.cjs +3 -3
- package/dist/esm/accordion/accordion.js +182 -0
- package/dist/esm/accordion/index.js +2 -0
- package/dist/esm/avatar/avatar-context.js +9 -0
- package/dist/esm/avatar/avatar-group-context.js +84 -0
- package/dist/esm/avatar/avatar-group.js +58 -0
- package/dist/esm/avatar/avatar.js +128 -0
- package/dist/esm/avatar/hooks/use-img-loading-status.js +66 -0
- package/dist/esm/avatar/index.js +13 -0
- package/dist/esm/avatar/utils.js +7 -0
- package/dist/esm/badge/badge.js +1 -1
- package/dist/esm/banner/banner.js +3 -3
- package/dist/esm/button/button.js +12 -9
- package/dist/esm/calendar/calendar-header.js +2 -2
- package/dist/esm/checkbox/checkbox.js +4 -4
- package/dist/esm/combo-box/combo-box.js +3 -3
- package/dist/esm/date-picker/date-picker.js +4 -3
- package/dist/esm/date-range-picker/date-range-picker.js +2 -2
- package/dist/esm/field/field.js +1 -1
- package/dist/esm/file-dropzone/file-dropzone.js +12 -8
- package/dist/esm/file-dropzone/file-info.js +4 -3
- package/dist/esm/file-dropzone/utils.js +4 -4
- package/dist/esm/govt-banner/govt-banner.js +4 -4
- package/dist/esm/hooks/use-scroll-position.js +51 -0
- package/dist/esm/index.js +24 -7
- package/dist/esm/menu/menu.js +2 -2
- package/dist/esm/modal/modal-content.js +2 -2
- package/dist/esm/navbar/index.js +10 -0
- package/dist/esm/navbar/navbar-brand.js +26 -0
- package/dist/esm/navbar/navbar-content.js +31 -0
- package/dist/esm/navbar/navbar-context.js +11 -0
- package/dist/esm/navbar/navbar-item.js +27 -0
- package/dist/esm/navbar/navbar-menu/i18n.js +21 -0
- package/dist/esm/navbar/navbar-menu/item.js +42 -0
- package/dist/esm/navbar/navbar-menu/menu.js +60 -0
- package/dist/esm/navbar/navbar-menu/toggle.js +93 -0
- package/dist/esm/navbar/navbar.js +48 -0
- package/dist/esm/navbar/use-navbar.js +124 -0
- package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/Overlay.js +52 -0
- package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/PortalProvider.js +20 -0
- package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/usePreventScroll.js +206 -0
- package/dist/esm/node_modules/.pnpm/@react-aria_ssr@3.9.10_react@19.2.3/node_modules/@react-aria/ssr/dist/SSRProvider.js +102 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/user.js +17 -0
- package/dist/esm/number-field/number-field.js +3 -3
- package/dist/esm/pagination/pagination.js +3 -3
- package/dist/esm/pagination/use-pagination-item.js +1 -1
- package/dist/esm/range-calendar/range-calendar.js +1 -1
- package/dist/esm/select/select.js +91 -19
- package/dist/esm/system/react-utils/children.js +29 -0
- package/dist/esm/system/utils.js +2 -49
- package/dist/esm/tag-field/tag-field-tag-list.js +1 -1
- package/dist/esm/tag-field/tag-field.js +1 -1
- package/dist/esm/toast/index.js +3 -0
- package/dist/esm/toast/toast.js +86 -0
- package/dist/types/accordion/accordion.d.ts +50 -0
- package/dist/types/accordion/accordion.d.ts.map +1 -0
- package/dist/types/accordion/index.d.ts +2 -0
- package/dist/types/accordion/index.d.ts.map +1 -0
- package/dist/types/avatar/avatar-context.d.ts +12 -0
- package/dist/types/avatar/avatar-context.d.ts.map +1 -0
- package/dist/types/avatar/avatar-group-context.d.ts +70 -0
- package/dist/types/avatar/avatar-group-context.d.ts.map +1 -0
- package/dist/types/avatar/avatar-group.d.ts +5 -0
- package/dist/types/avatar/avatar-group.d.ts.map +1 -0
- package/dist/types/avatar/avatar.d.ts +18 -0
- package/dist/types/avatar/avatar.d.ts.map +1 -0
- package/dist/types/avatar/hooks/use-img-loading-status.d.ts +4 -0
- package/dist/types/avatar/hooks/use-img-loading-status.d.ts.map +1 -0
- package/dist/types/avatar/index.d.ts +15 -0
- package/dist/types/avatar/index.d.ts.map +1 -0
- package/dist/types/avatar/utils.d.ts +2 -0
- package/dist/types/avatar/utils.d.ts.map +1 -0
- package/dist/types/button/button.d.ts +12 -6
- package/dist/types/button/button.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/checkbox/checkbox-group-style-context.d.ts +1 -1
- package/dist/types/checkbox/checkbox-group-style-context.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/file-dropzone/file-dropzone.d.ts +8 -2
- package/dist/types/file-dropzone/file-dropzone.d.ts.map +1 -1
- package/dist/types/file-dropzone/file-info.d.ts.map +1 -1
- package/dist/types/file-dropzone/types.d.ts +1 -0
- package/dist/types/file-dropzone/types.d.ts.map +1 -1
- package/dist/types/file-dropzone/utils.d.ts +2 -1
- package/dist/types/file-dropzone/utils.d.ts.map +1 -1
- package/dist/types/hooks/use-scroll-position.d.ts +29 -0
- package/dist/types/hooks/use-scroll-position.d.ts.map +1 -0
- package/dist/types/index.d.mts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/menu/menu.d.ts.map +1 -1
- package/dist/types/navbar/index.d.ts +17 -0
- package/dist/types/navbar/index.d.ts.map +1 -0
- package/dist/types/navbar/navbar-brand.d.ts +6 -0
- package/dist/types/navbar/navbar-brand.d.ts.map +1 -0
- package/dist/types/navbar/navbar-content.d.ts +14 -0
- package/dist/types/navbar/navbar-content.d.ts.map +1 -0
- package/dist/types/navbar/navbar-context.d.ts +182 -0
- package/dist/types/navbar/navbar-context.d.ts.map +1 -0
- package/dist/types/navbar/navbar-item.d.ts +11 -0
- package/dist/types/navbar/navbar-item.d.ts.map +1 -0
- package/dist/types/navbar/navbar-menu/i18n.d.ts +3 -0
- package/dist/types/navbar/navbar-menu/i18n.d.ts.map +1 -0
- package/dist/types/navbar/navbar-menu/item.d.ts +16 -0
- package/dist/types/navbar/navbar-menu/item.d.ts.map +1 -0
- package/dist/types/navbar/navbar-menu/menu.d.ts +11 -0
- package/dist/types/navbar/navbar-menu/menu.d.ts.map +1 -0
- package/dist/types/navbar/navbar-menu/toggle.d.ts +12 -0
- package/dist/types/navbar/navbar-menu/toggle.d.ts.map +1 -0
- package/dist/types/navbar/navbar.d.ts +6 -0
- package/dist/types/navbar/navbar.d.ts.map +1 -0
- package/dist/types/navbar/use-navbar.d.ts +163 -0
- package/dist/types/navbar/use-navbar.d.ts.map +1 -0
- package/dist/types/range-calendar/range-calendar.d.ts.map +1 -1
- package/dist/types/select/select-item.d.ts +1 -2
- package/dist/types/select/select-item.d.ts.map +1 -1
- package/dist/types/select/select.d.ts +14 -0
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/spinner/use-spinner.d.ts +8 -8
- package/dist/types/system/react-utils/children.d.ts +13 -0
- package/dist/types/system/react-utils/children.d.ts.map +1 -0
- package/dist/types/system/react-utils/context.d.ts +4 -4
- package/dist/types/system/react-utils/context.d.ts.map +1 -1
- package/dist/types/system/react-utils/index.d.ts +5 -3
- package/dist/types/system/react-utils/index.d.ts.map +1 -1
- package/dist/types/system/utils.d.ts +1 -833
- package/dist/types/system/utils.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-item.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-list.d.ts.map +1 -1
- package/dist/types/toast/index.d.ts +3 -0
- package/dist/types/toast/index.d.ts.map +1 -0
- package/dist/types/toast/toast.d.ts +9 -0
- package/dist/types/toast/toast.d.ts.map +1 -0
- package/package.json +13 -12
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/calendar.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/check.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/ellipsis.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/external-link.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/info.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/landmark.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/lock.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/minus.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/plus.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/trash-2.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/upload.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/x.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/Icon.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/calendar.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/check.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevrons-right.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/circle-alert.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/external-link.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/info.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/landmark.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/lock.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/minus.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/plus.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/trash-2.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/upload.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/x.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { useRef, useState, useLayoutEffect, useSyncExternalStore } from 'react';
|
|
3
|
+
|
|
4
|
+
function useIsHydrated() {
|
|
5
|
+
return useSyncExternalStore(
|
|
6
|
+
subscribe,
|
|
7
|
+
() => true,
|
|
8
|
+
() => false
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
function subscribe() {
|
|
12
|
+
return () => {
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function resolveLoadingStatus(image, src) {
|
|
16
|
+
if (!image) {
|
|
17
|
+
return "idle";
|
|
18
|
+
}
|
|
19
|
+
if (!src) {
|
|
20
|
+
return "error";
|
|
21
|
+
}
|
|
22
|
+
if (image.src !== src) {
|
|
23
|
+
image.src = src;
|
|
24
|
+
}
|
|
25
|
+
return image.complete && image.naturalWidth > 0 ? "loaded" : "loading";
|
|
26
|
+
}
|
|
27
|
+
function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
|
28
|
+
const isHydrated = useIsHydrated();
|
|
29
|
+
const imageRef = useRef(null);
|
|
30
|
+
const image = (() => {
|
|
31
|
+
if (!isHydrated) return null;
|
|
32
|
+
if (!imageRef.current) {
|
|
33
|
+
imageRef.current = new window.Image();
|
|
34
|
+
}
|
|
35
|
+
return imageRef.current;
|
|
36
|
+
})();
|
|
37
|
+
const [loadingStatus, setLoadingStatus] = useState(
|
|
38
|
+
() => resolveLoadingStatus(image, src)
|
|
39
|
+
);
|
|
40
|
+
useLayoutEffect(() => {
|
|
41
|
+
setLoadingStatus(resolveLoadingStatus(image, src));
|
|
42
|
+
}, [image, src]);
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
const updateStatus = (status) => () => {
|
|
45
|
+
setLoadingStatus(status);
|
|
46
|
+
};
|
|
47
|
+
if (!image) return;
|
|
48
|
+
const handleLoad = updateStatus("loaded");
|
|
49
|
+
const handleError = updateStatus("error");
|
|
50
|
+
image.addEventListener("load", handleLoad);
|
|
51
|
+
image.addEventListener("error", handleError);
|
|
52
|
+
if (referrerPolicy) {
|
|
53
|
+
image.referrerPolicy = referrerPolicy;
|
|
54
|
+
}
|
|
55
|
+
if (typeof crossOrigin === "string") {
|
|
56
|
+
image.crossOrigin = crossOrigin;
|
|
57
|
+
}
|
|
58
|
+
return () => {
|
|
59
|
+
image.removeEventListener("load", handleLoad);
|
|
60
|
+
image.removeEventListener("error", handleError);
|
|
61
|
+
};
|
|
62
|
+
}, [image, crossOrigin, referrerPolicy]);
|
|
63
|
+
return loadingStatus;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { useImageLoadingStatus };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { AvatarRoot, AvatarFallback, AvatarImage } from './avatar.js';
|
|
3
|
+
export { AvatarContext, useAvatarContext } from './avatar-context.js';
|
|
4
|
+
export { AvatarGroup } from './avatar-group.js';
|
|
5
|
+
export { AvatarGroupProvider, useAvatarGroup } from './avatar-group-context.js';
|
|
6
|
+
|
|
7
|
+
const Avatar = Object.assign(AvatarRoot, {
|
|
8
|
+
Root: AvatarRoot,
|
|
9
|
+
Image: AvatarImage,
|
|
10
|
+
Fallback: AvatarFallback
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const getInitialsFromText = (text, limit = 2) => {
|
|
3
|
+
const initials = text?.trim().split(/[\s\-_.]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase()).join("") || "";
|
|
4
|
+
return initials.slice(0, limit);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export { getInitialsFromText };
|
package/dist/esm/badge/badge.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef, useMemo } from 'react';
|
|
5
5
|
import { useBadge } from './use-badge.js';
|
|
6
|
-
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
6
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
7
7
|
|
|
8
8
|
const Badge = forwardRef((props, ref) => {
|
|
9
9
|
const {
|
|
@@ -5,10 +5,10 @@ import { useMemo, useRef } from 'react';
|
|
|
5
5
|
import { useMessageFormatter, useDisclosure } from 'react-aria';
|
|
6
6
|
import { useDisclosureState } from 'react-stately';
|
|
7
7
|
import { bannerStyles } from '@opengovsg/oui-theme';
|
|
8
|
-
import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.js';
|
|
9
|
-
import Info from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.js';
|
|
10
8
|
import { Button } from '../button/button.js';
|
|
11
|
-
import
|
|
9
|
+
import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-alert.js';
|
|
10
|
+
import Info from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/info.js';
|
|
11
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
12
12
|
|
|
13
13
|
const i18nStrings = {
|
|
14
14
|
"en-SG": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef, useMemo } from 'react';
|
|
5
5
|
import { chain } from '@react-aria/utils';
|
|
6
6
|
import { Button as Button$1, composeRenderProps } from 'react-aria-components';
|
|
@@ -8,6 +8,7 @@ import { buttonStyles } from '@opengovsg/oui-theme';
|
|
|
8
8
|
import { Ripple } from '../ripple/ripple.js';
|
|
9
9
|
import { useRipple } from '../ripple/use-ripple.js';
|
|
10
10
|
import { Spinner } from '../spinner/spinner.js';
|
|
11
|
+
import { renderChildren } from '../system/react-utils/children.js';
|
|
11
12
|
|
|
12
13
|
const Button = forwardRef(
|
|
13
14
|
({
|
|
@@ -21,6 +22,7 @@ const Button = forwardRef(
|
|
|
21
22
|
size = "md",
|
|
22
23
|
spinnerPlacement = "start",
|
|
23
24
|
loadingText,
|
|
25
|
+
pendingElement,
|
|
24
26
|
onPress,
|
|
25
27
|
children,
|
|
26
28
|
disableRipple,
|
|
@@ -47,7 +49,7 @@ const Button = forwardRef(
|
|
|
47
49
|
const spinnerSize = buttonSpinnerSizeMap[size];
|
|
48
50
|
return /* @__PURE__ */ jsx(Spinner, { size: spinnerSize });
|
|
49
51
|
}, [size, spinnerProp]);
|
|
50
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
51
53
|
Button$1,
|
|
52
54
|
{
|
|
53
55
|
...props,
|
|
@@ -68,15 +70,16 @@ const Button = forwardRef(
|
|
|
68
70
|
isPending,
|
|
69
71
|
onPress: chain(onPress, onPressRipple),
|
|
70
72
|
ref,
|
|
71
|
-
children: [
|
|
72
|
-
startContent,
|
|
73
|
-
isPending && spinnerPlacement === "start" ? spinner : null,
|
|
74
|
-
isPending ? null : children,
|
|
73
|
+
children: (renderProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
+
renderChildren(renderProps, startContent),
|
|
75
|
+
isPending && spinnerPlacement === "start" ? renderChildren(renderProps, spinner) : null,
|
|
76
|
+
isPending ? null : renderChildren(renderProps, children),
|
|
75
77
|
isPending && loadingText ? loadingText : null,
|
|
76
|
-
isPending &&
|
|
77
|
-
|
|
78
|
+
isPending && pendingElement ? renderChildren(renderProps, pendingElement) : null,
|
|
79
|
+
isPending && spinnerPlacement === "end" ? renderChildren(renderProps, spinner) : null,
|
|
80
|
+
renderChildren(renderProps, endContent),
|
|
78
81
|
!disableRipple && /* @__PURE__ */ jsx(Ripple, { onClear: onClearRipple, ripples })
|
|
79
|
-
]
|
|
82
|
+
] })
|
|
80
83
|
}
|
|
81
84
|
);
|
|
82
85
|
}
|
|
@@ -8,8 +8,8 @@ import { AgnosticCalendarStateContext } from './agnostic-calendar-state-context.
|
|
|
8
8
|
import { CalendarMonthDaySelector } from './calendar-month-day-selector.js';
|
|
9
9
|
import { useCalendarStyleContext } from './calendar-style-context.js';
|
|
10
10
|
import { useLocalizedMonthYear } from './utils.js';
|
|
11
|
-
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
12
|
-
import ChevronLeft from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
11
|
+
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
12
|
+
import ChevronLeft from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-left.js';
|
|
13
13
|
|
|
14
14
|
function CalendarHeader({ offsetMonths = 0 }) {
|
|
15
15
|
const { direction } = useLocale();
|
|
@@ -6,8 +6,8 @@ import { checkboxStyles, checkboxGroupStyles } from '@opengovsg/oui-theme';
|
|
|
6
6
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
8
|
import { useCheckboxGroupStyleContext, CheckboxGroupStyleContext } from './checkbox-group-style-context.js';
|
|
9
|
-
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
10
|
-
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
9
|
+
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
10
|
+
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
11
11
|
|
|
12
12
|
const Checkbox = ({
|
|
13
13
|
classNames,
|
|
@@ -18,8 +18,8 @@ const Checkbox = ({
|
|
|
18
18
|
originalProps,
|
|
19
19
|
checkboxStyles.variantKeys
|
|
20
20
|
);
|
|
21
|
-
const
|
|
22
|
-
const styles = checkboxStyles({ size, ...variants });
|
|
21
|
+
const context = useCheckboxGroupStyleContext();
|
|
22
|
+
const styles = checkboxStyles({ size: context?.size, ...variants });
|
|
23
23
|
return /* @__PURE__ */ jsx(
|
|
24
24
|
Checkbox$1,
|
|
25
25
|
{
|
|
@@ -9,9 +9,9 @@ import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
|
9
9
|
import { Popover } from '../popover/popover.js';
|
|
10
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
11
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
12
|
-
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
13
|
-
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
14
|
-
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
12
|
+
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
13
|
+
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
14
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
17
|
switch (size) {
|
|
@@ -4,13 +4,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DatePicker as DatePicker$1, Dialog } from 'react-aria-components';
|
|
6
6
|
import { datePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Button } from '../button/button.js';
|
|
8
|
+
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
9
|
+
import '@internationalized/date';
|
|
7
10
|
import { DateInput } from '../date-field/date-field.js';
|
|
8
11
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
12
|
import { Popover } from '../popover/popover.js';
|
|
10
13
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
|
-
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
12
|
-
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
13
|
-
import { Button } from '../button/button.js';
|
|
14
|
+
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
14
15
|
|
|
15
16
|
function DatePicker(originalProps) {
|
|
16
17
|
const [
|
|
@@ -5,13 +5,13 @@ import { useMemo } from 'react';
|
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { DateRangePicker as DateRangePicker$1, Dialog } from 'react-aria-components';
|
|
7
7
|
import { dateRangePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Button } from '../button/button.js';
|
|
8
9
|
import { DateInput } from '../date-field/date-field.js';
|
|
9
10
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
10
11
|
import { Popover } from '../popover/popover.js';
|
|
11
12
|
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
12
13
|
import { mapPropsVariants } from '../system/utils.js';
|
|
13
|
-
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
14
|
-
import { Button } from '../button/button.js';
|
|
14
|
+
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
package/dist/esm/field/field.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { Label as Label$1, Text, FieldError as FieldError$1, Group } from 'react-aria-components';
|
|
6
6
|
import { labelStyles, descriptionStyles, fieldErrorStyles, composeRenderProps, fieldGroupStyles } from '@opengovsg/oui-theme';
|
|
7
|
-
import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
7
|
+
import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-alert.js';
|
|
8
8
|
|
|
9
9
|
function Label({ size, className, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsx(Label$1, { ...props, className: labelStyles({ className, size }) });
|
|
@@ -13,7 +13,7 @@ import { mapPropsVariants } from '../system/utils.js';
|
|
|
13
13
|
import { FileDropzoneStyleContext, FileDropzoneStateContext, useFileDropzoneStateContext, useFileDropzoneStyleContext } from './contexts.js';
|
|
14
14
|
import { FileInfo } from './file-info.js';
|
|
15
15
|
import { formatErrorMessage, formatBytes } from './utils.js';
|
|
16
|
-
import Upload from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
16
|
+
import Upload from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/upload.js';
|
|
17
17
|
|
|
18
18
|
const FileDropzone = (originalProps) => {
|
|
19
19
|
const [props, variantProps] = mapPropsVariants(
|
|
@@ -23,6 +23,7 @@ const FileDropzone = (originalProps) => {
|
|
|
23
23
|
const {
|
|
24
24
|
name,
|
|
25
25
|
allowedMimeTypes = [],
|
|
26
|
+
fileSizeBase = "binary",
|
|
26
27
|
maxFileSize = Number.POSITIVE_INFINITY,
|
|
27
28
|
minFileSize = 0,
|
|
28
29
|
showFileSizeText = true,
|
|
@@ -67,9 +68,10 @@ const FileDropzone = (originalProps) => {
|
|
|
67
68
|
(error) => formatErrorMessage(error, {
|
|
68
69
|
maxFileSize,
|
|
69
70
|
minFileSize,
|
|
70
|
-
maxFiles
|
|
71
|
+
maxFiles,
|
|
72
|
+
fileSizeBase
|
|
71
73
|
}),
|
|
72
|
-
[maxFileSize, maxFiles, minFileSize]
|
|
74
|
+
[fileSizeBase, maxFileSize, maxFiles, minFileSize]
|
|
73
75
|
);
|
|
74
76
|
const onDrop = useCallback(
|
|
75
77
|
(acceptedFiles, fileRejections) => {
|
|
@@ -127,19 +129,20 @@ const FileDropzone = (originalProps) => {
|
|
|
127
129
|
const shouldShow = showFileSizeText && (notDefaultMaxFileSize || notDefaultMinFileSize);
|
|
128
130
|
if (!shouldShow) return null;
|
|
129
131
|
if (notDefaultMaxFileSize && notDefaultMinFileSize) {
|
|
130
|
-
return `File size must be between ${formatBytes(minFileSize, 2)} and ${formatBytes(
|
|
132
|
+
return `File size must be between ${formatBytes(minFileSize, 2, fileSizeBase)} and ${formatBytes(
|
|
131
133
|
maxFileSize,
|
|
132
|
-
2
|
|
134
|
+
2,
|
|
135
|
+
fileSizeBase
|
|
133
136
|
)}`;
|
|
134
137
|
}
|
|
135
138
|
if (notDefaultMaxFileSize) {
|
|
136
|
-
return `Maximum file size: ${formatBytes(maxFileSize, 2)}`;
|
|
139
|
+
return `Maximum file size: ${formatBytes(maxFileSize, 2, fileSizeBase)}`;
|
|
137
140
|
}
|
|
138
141
|
if (notDefaultMinFileSize) {
|
|
139
|
-
return `Minimum file size: ${formatBytes(minFileSize, 2)}`;
|
|
142
|
+
return `Minimum file size: ${formatBytes(minFileSize, 2, fileSizeBase)}`;
|
|
140
143
|
}
|
|
141
144
|
return null;
|
|
142
|
-
}, [maxFileSize, minFileSize, showFileSizeText]);
|
|
145
|
+
}, [maxFileSize, minFileSize, showFileSizeText, fileSizeBase]);
|
|
143
146
|
const triggerFileSelector = useCallback(() => {
|
|
144
147
|
if (isDisabled || isReadOnly) return;
|
|
145
148
|
dropzoneState.inputRef.current?.click();
|
|
@@ -185,6 +188,7 @@ const FileDropzone = (originalProps) => {
|
|
|
185
188
|
{
|
|
186
189
|
isDisabled,
|
|
187
190
|
isReadOnly,
|
|
191
|
+
fileSizeBase,
|
|
188
192
|
maxFiles,
|
|
189
193
|
maxFileSize,
|
|
190
194
|
showDropzone,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
5
|
import { fileInfoDropzoneStyles, cn } from '@opengovsg/oui-theme';
|
|
6
|
+
import { Button } from '../button/button.js';
|
|
6
7
|
import { useFileDropzoneStateContext, useFileDropzoneStyleContext } from './contexts.js';
|
|
7
8
|
import { formatBytes } from './utils.js';
|
|
8
|
-
import Trash2 from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
9
|
-
import { Button } from '../button/button.js';
|
|
9
|
+
import Trash2 from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/trash-2.js';
|
|
10
10
|
|
|
11
11
|
const FileInfo = ({ file, imagePreview, classNames }) => {
|
|
12
12
|
const {
|
|
@@ -17,7 +17,8 @@ const FileInfo = ({ file, imagePreview, classNames }) => {
|
|
|
17
17
|
isReadOnly
|
|
18
18
|
} = useFileDropzoneStateContext();
|
|
19
19
|
const { size, variant, itemClassNames } = useFileDropzoneStyleContext();
|
|
20
|
-
const
|
|
20
|
+
const { fileSizeBase } = useFileDropzoneStateContext();
|
|
21
|
+
const readableFileSize = formatBytes(file.size, 2, fileSizeBase);
|
|
21
22
|
const styles = fileInfoDropzoneStyles({
|
|
22
23
|
size,
|
|
23
24
|
variant,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { ErrorCode } from 'react-dropzone';
|
|
3
3
|
|
|
4
|
-
const formatBytes = (bytes, decimals = 2, size) => {
|
|
5
|
-
const k = 1e3;
|
|
4
|
+
const formatBytes = (bytes, decimals = 2, base = "binary", size) => {
|
|
5
|
+
const k = base === "binary" ? 1024 : 1e3;
|
|
6
6
|
const dm = decimals < 0 ? 0 : decimals;
|
|
7
7
|
const sizes = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
8
8
|
if (bytes === 0 || bytes === void 0)
|
|
@@ -14,9 +14,9 @@ const formatErrorMessage = (error, config) => {
|
|
|
14
14
|
const { maxFileSize, minFileSize, maxFiles } = config;
|
|
15
15
|
switch (error.code) {
|
|
16
16
|
case ErrorCode.FileTooLarge:
|
|
17
|
-
return `You have exceeded the size limit, please upload a file below ${formatBytes(maxFileSize, 2)}`;
|
|
17
|
+
return `You have exceeded the size limit, please upload a file below ${formatBytes(maxFileSize, 2, config.fileSizeBase)}`;
|
|
18
18
|
case ErrorCode.FileTooSmall:
|
|
19
|
-
return `Please upload a file above ${formatBytes(minFileSize, 2)}`;
|
|
19
|
+
return `Please upload a file above ${formatBytes(minFileSize, 2, config.fileSizeBase)}`;
|
|
20
20
|
case ErrorCode.TooManyFiles:
|
|
21
21
|
return `Maximum number of files allowed is ${maxFiles}.`;
|
|
22
22
|
default: {
|
|
@@ -5,10 +5,10 @@ import { useRef } from 'react';
|
|
|
5
5
|
import { useDisclosure, useButton, useFocusRing, mergeProps } from 'react-aria';
|
|
6
6
|
import { useDisclosureState } from 'react-stately';
|
|
7
7
|
import { govtBannerStyles, dataAttr, twMerge } from '@opengovsg/oui-theme';
|
|
8
|
-
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
9
|
-
import Landmark from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
10
|
-
import ExternalLink from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
11
|
-
import Lock from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
8
|
+
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
9
|
+
import Landmark from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/landmark.js';
|
|
10
|
+
import ExternalLink from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/external-link.js';
|
|
11
|
+
import Lock from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/lock.js';
|
|
12
12
|
|
|
13
13
|
function GovtBanner({
|
|
14
14
|
environment,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const isBrowser = typeof window !== "undefined";
|
|
5
|
+
function getScrollPosition(element) {
|
|
6
|
+
if (!isBrowser) return { x: 0, y: 0 };
|
|
7
|
+
if (!element) {
|
|
8
|
+
return { x: window.scrollX, y: window.scrollY };
|
|
9
|
+
}
|
|
10
|
+
return { x: element.scrollLeft, y: element.scrollTop };
|
|
11
|
+
}
|
|
12
|
+
const useScrollPosition = (props) => {
|
|
13
|
+
const { elementRef, delay = 30, callback, isEnabled } = props;
|
|
14
|
+
const position = useRef(
|
|
15
|
+
isEnabled ? getScrollPosition(elementRef?.current) : { x: 0, y: 0 }
|
|
16
|
+
);
|
|
17
|
+
const throttleTimeout = useRef(null);
|
|
18
|
+
const handler = useCallback(() => {
|
|
19
|
+
const currPos = getScrollPosition(elementRef?.current);
|
|
20
|
+
if (typeof callback === "function") {
|
|
21
|
+
callback({ prevPos: position.current, currPos });
|
|
22
|
+
}
|
|
23
|
+
position.current = currPos;
|
|
24
|
+
throttleTimeout.current = null;
|
|
25
|
+
}, [callback, elementRef]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!isEnabled) return;
|
|
28
|
+
const handleScroll = () => {
|
|
29
|
+
if (delay) {
|
|
30
|
+
if (throttleTimeout.current) {
|
|
31
|
+
clearTimeout(throttleTimeout.current);
|
|
32
|
+
}
|
|
33
|
+
throttleTimeout.current = setTimeout(handler, delay);
|
|
34
|
+
} else {
|
|
35
|
+
handler();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const target = elementRef?.current || window;
|
|
39
|
+
target.addEventListener("scroll", handleScroll);
|
|
40
|
+
return () => {
|
|
41
|
+
target.removeEventListener("scroll", handleScroll);
|
|
42
|
+
if (throttleTimeout.current) {
|
|
43
|
+
clearTimeout(throttleTimeout.current);
|
|
44
|
+
throttleTimeout.current = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}, [elementRef?.current, delay, handler, isEnabled]);
|
|
48
|
+
return position.current;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { useScrollPosition };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
3
3
|
export { useDraggable } from './hooks/use-draggable.js';
|
|
4
|
+
export { Button } from './button/button.js';
|
|
4
5
|
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
5
6
|
export { Ripple } from './ripple/ripple.js';
|
|
6
7
|
export { useRipple } from './ripple/use-ripple.js';
|
|
@@ -17,11 +18,17 @@ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
|
17
18
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
18
19
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
19
20
|
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
21
|
+
export { Banner } from './banner/banner.js';
|
|
20
22
|
export { TagField } from './tag-field/tag-field.js';
|
|
21
23
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
22
24
|
export { Select } from './select/select.js';
|
|
23
25
|
export { SelectItem } from './select/select-item.js';
|
|
24
26
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
27
|
+
export { Badge } from './badge/badge.js';
|
|
28
|
+
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
29
|
+
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
30
|
+
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
31
|
+
export { CalendarDate } from '@internationalized/date';
|
|
25
32
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
26
33
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
27
34
|
export { Popover } from './popover/popover.js';
|
|
@@ -46,10 +53,20 @@ export { ModalFooter } from './modal/modal-footer.js';
|
|
|
46
53
|
export { ModalBody } from './modal/modal-body.js';
|
|
47
54
|
export { ModalHeader } from './modal/modal-header.js';
|
|
48
55
|
export { ModalVariantContext, useModalVariantContext } from './modal/modal-variant-context.js';
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
+
export { Toaster } from './toast/toast.js';
|
|
57
|
+
export { Navbar } from './navbar/navbar.js';
|
|
58
|
+
export { NavbarBrand } from './navbar/navbar-brand.js';
|
|
59
|
+
export { NavbarContent } from './navbar/navbar-content.js';
|
|
60
|
+
export { NavbarMenu } from './navbar/navbar-menu/menu.js';
|
|
61
|
+
export { NavbarMenuItem } from './navbar/navbar-menu/item.js';
|
|
62
|
+
export { NavbarMenuToggle } from './navbar/navbar-menu/toggle.js';
|
|
63
|
+
export { NavbarItem } from './navbar/navbar-item.js';
|
|
64
|
+
export { useNavbar } from './navbar/use-navbar.js';
|
|
65
|
+
export { NavbarProvider, useNavbarContext } from './navbar/navbar-context.js';
|
|
66
|
+
export { Avatar } from './avatar/index.js';
|
|
67
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionStyleContext, useAccordionStyleContext } from './accordion/accordion.js';
|
|
68
|
+
export { toast } from 'sonner';
|
|
69
|
+
export { AvatarContext, useAvatarContext } from './avatar/avatar-context.js';
|
|
70
|
+
export { AvatarGroup } from './avatar/avatar-group.js';
|
|
71
|
+
export { AvatarGroupProvider, useAvatarGroup } from './avatar/avatar-group-context.js';
|
|
72
|
+
export { AvatarFallback, AvatarImage, AvatarRoot } from './avatar/avatar.js';
|
package/dist/esm/menu/menu.js
CHANGED
|
@@ -6,9 +6,9 @@ import { useContextProps, MenuItem as MenuItem$1, composeRenderProps, Provider,
|
|
|
6
6
|
import { listBoxItemStyles, menuItemStyles, menuStyles, menuSectionStyles, menuDividerStyles } from '@opengovsg/oui-theme';
|
|
7
7
|
import { Popover } from '../popover/popover.js';
|
|
8
8
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
9
|
-
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
10
|
-
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
11
9
|
import { createContext } from '../system/react-utils/context.js';
|
|
10
|
+
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
11
|
+
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
12
12
|
|
|
13
13
|
const [MenuVariantContext, useMenuVariantContext] = createContext({
|
|
14
14
|
name: "MenuVariantContext",
|
|
@@ -5,10 +5,10 @@ import { useContext, isValidElement } from 'react';
|
|
|
5
5
|
import { useMessageFormatter } from 'react-aria';
|
|
6
6
|
import { Dialog } from 'react-aria-components';
|
|
7
7
|
import { cn } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Button } from '../button/button.js';
|
|
8
9
|
import { i18nStrings } from './i18n.js';
|
|
9
10
|
import { ModalVariantContext } from './modal-variant-context.js';
|
|
10
|
-
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
11
|
-
import { Button } from '../button/button.js';
|
|
11
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
12
12
|
|
|
13
13
|
function ModalContent({
|
|
14
14
|
closeButtonContent: closeButtonContentProp,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export { Navbar } from './navbar.js';
|
|
3
|
+
export { NavbarBrand } from './navbar-brand.js';
|
|
4
|
+
export { NavbarContent } from './navbar-content.js';
|
|
5
|
+
export { NavbarMenu } from './navbar-menu/menu.js';
|
|
6
|
+
export { NavbarMenuItem } from './navbar-menu/item.js';
|
|
7
|
+
export { NavbarMenuToggle } from './navbar-menu/toggle.js';
|
|
8
|
+
export { NavbarItem } from './navbar-item.js';
|
|
9
|
+
export { useNavbar } from './use-navbar.js';
|
|
10
|
+
export { NavbarProvider, useNavbarContext } from './navbar-context.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { cn } from '@opengovsg/oui-theme';
|
|
5
|
+
import { forwardRef } from '../system/utils.js';
|
|
6
|
+
import { useNavbarContext } from './navbar-context.js';
|
|
7
|
+
import { useDomRef } from '../system/react-utils/refs.js';
|
|
8
|
+
|
|
9
|
+
const NavbarBrand = forwardRef((props, ref) => {
|
|
10
|
+
const { as, className, children, ...otherProps } = props;
|
|
11
|
+
const Component = as || "div";
|
|
12
|
+
const domRef = useDomRef(ref);
|
|
13
|
+
const { slots, classNames } = useNavbarContext();
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Component,
|
|
16
|
+
{
|
|
17
|
+
ref: domRef,
|
|
18
|
+
className: slots.brand?.({ className: cn(classNames?.brand, className) }),
|
|
19
|
+
...otherProps,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
NavbarBrand.displayName = "NavbarBrand";
|
|
25
|
+
|
|
26
|
+
export { NavbarBrand };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { cn } from '@opengovsg/oui-theme';
|
|
5
|
+
import { forwardRef } from '../system/utils.js';
|
|
6
|
+
import { useNavbarContext } from './navbar-context.js';
|
|
7
|
+
import { useDomRef } from '../system/react-utils/refs.js';
|
|
8
|
+
|
|
9
|
+
const NavbarContent = forwardRef(
|
|
10
|
+
(props, ref) => {
|
|
11
|
+
const { as, className, children, justify = "start", ...otherProps } = props;
|
|
12
|
+
const Component = as || "div";
|
|
13
|
+
const domRef = useDomRef(ref);
|
|
14
|
+
const { slots, classNames } = useNavbarContext();
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Component,
|
|
17
|
+
{
|
|
18
|
+
ref: domRef,
|
|
19
|
+
className: slots.content?.({
|
|
20
|
+
className: cn(classNames?.content, className)
|
|
21
|
+
}),
|
|
22
|
+
"data-justify": justify,
|
|
23
|
+
...otherProps,
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
NavbarContent.displayName = "NavbarContent";
|
|
30
|
+
|
|
31
|
+
export { NavbarContent };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { createContext } from '../system/react-utils/context.js';
|
|
4
|
+
|
|
5
|
+
const [NavbarProvider, useNavbarContext] = createContext({
|
|
6
|
+
name: "NavbarContext",
|
|
7
|
+
strict: true,
|
|
8
|
+
errorMessage: "useNavbarContext: `context` is undefined. Seems you forgot to wrap component within <Navbar />"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { NavbarProvider, useNavbarContext };
|