@opengovsg/oui 0.0.0-snapshot-20251203100754 → 0.0.0-snapshot-20251216073051
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/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 +4 -4
- 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 +4 -4
- 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 +3 -3
- 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 +8 -8
- package/dist/cjs/date-field/date-field.cjs +4 -4
- package/dist/cjs/date-picker/date-picker.cjs +6 -6
- package/dist/cjs/date-range-picker/date-range-picker.cjs +8 -8
- package/dist/cjs/field/field.cjs +3 -3
- package/dist/cjs/file-dropzone/file-dropzone.cjs +13 -13
- package/dist/cjs/file-dropzone/file-info.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 +48 -22
- package/dist/cjs/input/input.cjs +2 -2
- package/dist/cjs/menu/menu.cjs +9 -9
- package/dist/cjs/modal/modal-body.cjs +2 -2
- package/dist/cjs/modal/modal-content.cjs +4 -4
- 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/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 +6 -6
- package/dist/cjs/ripple/use-ripple.cjs +4 -4
- package/dist/cjs/select/select.cjs +5 -5
- package/dist/cjs/spinner/use-spinner.cjs +3 -3
- package/dist/cjs/system/react-utils/children.cjs +26 -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 +6 -6
- 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/text-area-field/text-area-field.cjs +1 -1
- package/dist/cjs/text-field/text-field.cjs +1 -1
- 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/badge/badge.js +1 -1
- package/dist/esm/banner/banner.js +3 -3
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/calendar-header.js +2 -2
- package/dist/esm/calendar/calendar-month-day-selector.js +2 -2
- package/dist/esm/checkbox/checkbox.js +3 -3
- package/dist/esm/combo-box/combo-box.js +5 -5
- package/dist/esm/date-field/date-field.js +1 -1
- package/dist/esm/date-picker/date-picker.js +4 -4
- package/dist/esm/date-range-picker/date-range-picker.js +5 -5
- package/dist/esm/field/field.js +1 -1
- package/dist/esm/file-dropzone/file-dropzone.js +3 -3
- package/dist/esm/file-dropzone/file-info.js +1 -1
- 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 +19 -8
- package/dist/esm/menu/menu.js +3 -3
- package/dist/esm/modal/modal-content.js +1 -1
- 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/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/select/select.js +3 -3
- package/dist/esm/system/react-utils/children.js +23 -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 +4 -4
- package/dist/esm/text-area-field/text-area-field.js +1 -1
- package/dist/esm/text-field/text-field.js +1 -1
- package/dist/esm/toast/index.js +3 -0
- package/dist/esm/toast/toast.js +86 -0
- 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 +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.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/spinner/use-spinner.d.ts +8 -8
- package/dist/types/system/react-utils/children.d.ts +10 -0
- package/dist/types/system/react-utils/children.d.ts.map +1 -0
- 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/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 +8 -7
- /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
|
@@ -9,9 +9,9 @@ import { PaginationItemType } from './hooks/use-pagination.js';
|
|
|
9
9
|
import { PaginationCursor } from './pagination-cursor.js';
|
|
10
10
|
import { PaginationItem } from './pagination-item.js';
|
|
11
11
|
import { usePagination } from './use-pagination.js';
|
|
12
|
-
import ChevronLeft from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
13
|
-
import Ellipsis from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
14
|
-
import ChevronsRight 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.2.3/node_modules/lucide-react/dist/esm/icons/chevron-left.js';
|
|
13
|
+
import Ellipsis from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/ellipsis.js';
|
|
14
|
+
import ChevronsRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevrons-right.js';
|
|
15
15
|
|
|
16
16
|
const Pagination = forwardRef((props, ref) => {
|
|
17
17
|
const {
|
|
@@ -5,8 +5,8 @@ import { useFocusRing } from '@react-aria/focus';
|
|
|
5
5
|
import { usePress, useHover } from '@react-aria/interactions';
|
|
6
6
|
import { useRouter, mergeProps, chain, shouldClientNavigate } from '@react-aria/utils';
|
|
7
7
|
import { cn, dataAttr } from '@opengovsg/oui-theme';
|
|
8
|
-
import { filterDOMProps } from '../system/react-utils/filter-dom-props.js';
|
|
9
8
|
import { useDomRef } from '../system/react-utils/refs.js';
|
|
9
|
+
import { filterDOMProps } from '../system/react-utils/filter-dom-props.js';
|
|
10
10
|
|
|
11
11
|
function usePaginationItem(props) {
|
|
12
12
|
const {
|
|
@@ -4,11 +4,11 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { Provider, Select as Select$1, SelectValue, Virtualizer, ListLayout, ListBox } from 'react-aria-components';
|
|
6
6
|
import { selectStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
-
import { Popover } from '../popover/popover.js';
|
|
9
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
8
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
11
|
-
import
|
|
9
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
10
|
+
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';
|
|
11
|
+
import { Popover } from '../popover/popover.js';
|
|
12
12
|
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { Children, isValidElement } from 'react';
|
|
3
|
+
|
|
4
|
+
function getValidChildren(children) {
|
|
5
|
+
return Children.toArray(children).filter(
|
|
6
|
+
(child) => isValidElement(child)
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
const pickChildren = (children, targetChild) => {
|
|
10
|
+
const target = [];
|
|
11
|
+
const withoutTargetChildren = Children.map(children, (item) => {
|
|
12
|
+
if (!isValidElement(item)) return item;
|
|
13
|
+
if (item.type === targetChild) {
|
|
14
|
+
target.push(item);
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return item;
|
|
18
|
+
})?.filter(Boolean);
|
|
19
|
+
const targetChildren = target.length >= 0 ? target : void 0;
|
|
20
|
+
return [withoutTargetChildren, targetChildren];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { getValidChildren, pickChildren };
|
package/dist/esm/system/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { forwardRef as forwardRef$1
|
|
2
|
+
import { forwardRef as forwardRef$1 } from 'react';
|
|
3
3
|
|
|
4
4
|
function forwardRef(component) {
|
|
5
5
|
return forwardRef$1(component);
|
|
@@ -26,53 +26,6 @@ const mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
|
|
|
26
26
|
}
|
|
27
27
|
return [props, picked];
|
|
28
28
|
};
|
|
29
|
-
function useRenderProps(props) {
|
|
30
|
-
const {
|
|
31
|
-
className,
|
|
32
|
-
style,
|
|
33
|
-
children,
|
|
34
|
-
defaultClassName = void 0,
|
|
35
|
-
defaultChildren = void 0,
|
|
36
|
-
defaultStyle,
|
|
37
|
-
values
|
|
38
|
-
} = props;
|
|
39
|
-
return useMemo(() => {
|
|
40
|
-
let computedClassName;
|
|
41
|
-
let computedStyle;
|
|
42
|
-
let computedChildren;
|
|
43
|
-
if (typeof className === "function") {
|
|
44
|
-
computedClassName = className({ ...values, defaultClassName });
|
|
45
|
-
} else {
|
|
46
|
-
computedClassName = className;
|
|
47
|
-
}
|
|
48
|
-
if (typeof style === "function") {
|
|
49
|
-
computedStyle = style({ ...values, defaultStyle: defaultStyle || {} });
|
|
50
|
-
} else {
|
|
51
|
-
computedStyle = style;
|
|
52
|
-
}
|
|
53
|
-
if (typeof children === "function") {
|
|
54
|
-
computedChildren = children({ ...values, defaultChildren });
|
|
55
|
-
} else if (children == null) {
|
|
56
|
-
computedChildren = defaultChildren;
|
|
57
|
-
} else {
|
|
58
|
-
computedChildren = children;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
className: computedClassName ?? defaultClassName,
|
|
62
|
-
style: computedStyle || defaultStyle ? { ...defaultStyle, ...computedStyle } : void 0,
|
|
63
|
-
children: computedChildren ?? defaultChildren,
|
|
64
|
-
"data-rac": ""
|
|
65
|
-
};
|
|
66
|
-
}, [
|
|
67
|
-
className,
|
|
68
|
-
style,
|
|
69
|
-
children,
|
|
70
|
-
defaultClassName,
|
|
71
|
-
defaultChildren,
|
|
72
|
-
defaultStyle,
|
|
73
|
-
values
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
29
|
function removeDataAttributes(props) {
|
|
77
30
|
const prefix = /^(data-.*)$/;
|
|
78
31
|
const filteredProps = {};
|
|
@@ -94,4 +47,4 @@ function pickAriaAttributes(props) {
|
|
|
94
47
|
return filteredProps;
|
|
95
48
|
}
|
|
96
49
|
|
|
97
|
-
export { forwardRef, forwardRefGeneric, mapPropsVariants, pickAriaAttributes, removeDataAttributes
|
|
50
|
+
export { forwardRef, forwardRefGeneric, mapPropsVariants, pickAriaAttributes, removeDataAttributes };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useContext, useCallback } from 'react';
|
|
4
4
|
import { TagFieldStateContext } from './tag-field-state-context.js';
|
|
5
|
-
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
5
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
6
6
|
|
|
7
7
|
const TagFieldTagList = ({
|
|
8
8
|
classNames,
|
|
@@ -4,15 +4,15 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { createElement } from 'react';
|
|
5
5
|
import { composeRenderProps } from 'react-aria-components';
|
|
6
6
|
import { tagFieldStyles } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
|
-
import { Input } from '../input/input.js';
|
|
9
|
-
import { Popover } from '../popover/popover.js';
|
|
10
7
|
import { TagFieldItem } from './tag-field-item.js';
|
|
11
8
|
import { TagFieldList } from './tag-field-list.js';
|
|
12
9
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
13
10
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
14
11
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
15
|
-
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.
|
|
12
|
+
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';
|
|
13
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
|
+
import { Input } from '../input/input.js';
|
|
15
|
+
import { Popover } from '../popover/popover.js';
|
|
16
16
|
|
|
17
17
|
function TagField({
|
|
18
18
|
classNames,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { TextArea } from '../text-area/text-area.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
9
9
|
function TextAreaField({
|
|
10
10
|
label,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField as TextField$1 } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { Input } from '../input/input.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
9
9
|
function TextField({
|
|
10
10
|
label,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Toaster as Toaster$1 } from 'sonner';
|
|
5
|
+
export { toast } from 'sonner';
|
|
6
|
+
import { toastStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
9
|
+
import { Spinner } from '../spinner/spinner.js';
|
|
10
|
+
|
|
11
|
+
function Toaster(originalProps) {
|
|
12
|
+
const [{ toastOptions, closeButton = true, ...props }, variantProps] = mapPropsVariants(originalProps, toastStyles.variantKeys);
|
|
13
|
+
const styles = toastStyles(variantProps);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Toaster$1,
|
|
16
|
+
{
|
|
17
|
+
className: styles.base({
|
|
18
|
+
className: props.className ?? props.classNames?.base
|
|
19
|
+
}),
|
|
20
|
+
position: "top-center",
|
|
21
|
+
icons: {
|
|
22
|
+
loading: /* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
23
|
+
close: /* @__PURE__ */ jsx(X, {})
|
|
24
|
+
},
|
|
25
|
+
mobileOffset: 8,
|
|
26
|
+
offset: {
|
|
27
|
+
top: 8
|
|
28
|
+
},
|
|
29
|
+
closeButton,
|
|
30
|
+
toastOptions: {
|
|
31
|
+
classNames: {
|
|
32
|
+
toast: styles.toast({
|
|
33
|
+
className: props.classNames?.toast
|
|
34
|
+
}),
|
|
35
|
+
title: styles.title({
|
|
36
|
+
className: props.classNames?.title
|
|
37
|
+
}),
|
|
38
|
+
description: styles.description({
|
|
39
|
+
className: props.classNames?.description
|
|
40
|
+
}),
|
|
41
|
+
loader: styles.loader({
|
|
42
|
+
className: props.classNames?.loader
|
|
43
|
+
}),
|
|
44
|
+
closeButton: styles.closeButton({
|
|
45
|
+
className: props.classNames?.closeButton
|
|
46
|
+
}),
|
|
47
|
+
success: styles.success({
|
|
48
|
+
className: props.classNames?.success
|
|
49
|
+
}),
|
|
50
|
+
error: styles.error({
|
|
51
|
+
className: props.classNames?.error
|
|
52
|
+
}),
|
|
53
|
+
info: styles.info({
|
|
54
|
+
className: props.classNames?.info
|
|
55
|
+
}),
|
|
56
|
+
warning: styles.warning({
|
|
57
|
+
className: props.classNames?.warning
|
|
58
|
+
}),
|
|
59
|
+
loading: styles.loading({
|
|
60
|
+
className: props.classNames?.loading
|
|
61
|
+
}),
|
|
62
|
+
default: styles.default({
|
|
63
|
+
className: props.classNames?.default
|
|
64
|
+
}),
|
|
65
|
+
content: styles.content({
|
|
66
|
+
className: props.classNames?.content
|
|
67
|
+
}),
|
|
68
|
+
icon: styles.icon({
|
|
69
|
+
className: props.classNames?.icon
|
|
70
|
+
}),
|
|
71
|
+
actionButton: styles.actionButton({
|
|
72
|
+
className: props.classNames?.actionButton
|
|
73
|
+
}),
|
|
74
|
+
cancelButton: styles.cancelButton({
|
|
75
|
+
className: props.classNames?.cancelButton
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
unstyled: true,
|
|
79
|
+
...toastOptions
|
|
80
|
+
},
|
|
81
|
+
...props
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { Toaster };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type ScrollValue = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export interface UseScrollPositionOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The wait time in milliseconds before triggering the callback.
|
|
8
|
+
* @default 30
|
|
9
|
+
*/
|
|
10
|
+
delay?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the scroll position should be tracked or not.
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
isEnabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The element to track the scroll position for.
|
|
18
|
+
*/
|
|
19
|
+
elementRef?: React.RefObject<HTMLElement> | null;
|
|
20
|
+
/**
|
|
21
|
+
* The callback function to be called when the scroll position changes.
|
|
22
|
+
*/
|
|
23
|
+
callback?: ({ prevPos, currPos, }: {
|
|
24
|
+
prevPos: ScrollValue;
|
|
25
|
+
currPos: ScrollValue;
|
|
26
|
+
}) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const useScrollPosition: (props: UseScrollPositionOptions) => ScrollValue;
|
|
29
|
+
//# sourceMappingURL=use-scroll-position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-position.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-scroll-position.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAalD,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;IAChD;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EACV,OAAO,EACP,OAAO,GACR,EAAE;QACD,OAAO,EAAE,WAAW,CAAA;QACpB,OAAO,EAAE,WAAW,CAAA;KACrB,KAAK,IAAI,CAAA;CACX;AAED,eAAO,MAAM,iBAAiB,UACrB,wBAAwB,KAC9B,WAiDF,CAAA"}
|
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { Navbar } from "./navbar";
|
|
2
|
+
export { NavbarBrand } from "./navbar-brand";
|
|
3
|
+
export { NavbarContent } from "./navbar-content";
|
|
4
|
+
export { NavbarMenu } from "./navbar-menu/menu";
|
|
5
|
+
export { NavbarMenuItem } from "./navbar-menu/item";
|
|
6
|
+
export { NavbarMenuToggle } from "./navbar-menu/toggle";
|
|
7
|
+
export { NavbarItem } from "./navbar-item";
|
|
8
|
+
export { useNavbar } from "./use-navbar";
|
|
9
|
+
export { NavbarProvider, useNavbarContext } from "./navbar-context";
|
|
10
|
+
export type { NavbarProps } from "./navbar";
|
|
11
|
+
export type { NavbarBrandProps } from "./navbar-brand";
|
|
12
|
+
export type { NavbarContentProps } from "./navbar-content";
|
|
13
|
+
export type { NavbarMenuProps } from "./navbar-menu/menu";
|
|
14
|
+
export type { NavbarMenuItemProps } from "./navbar-menu/item";
|
|
15
|
+
export type { NavbarMenuToggleProps } from "./navbar-menu/toggle";
|
|
16
|
+
export type { NavbarItemProps } from "./navbar-item";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HtmlUiProps } from "../system/types";
|
|
2
|
+
export interface NavbarBrandProps extends HtmlUiProps<"div"> {
|
|
3
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
4
|
+
}
|
|
5
|
+
export declare const NavbarBrand: import("../system/utils").InternalForwardRefRenderFunction<"div", NavbarBrandProps, never>;
|
|
6
|
+
//# sourceMappingURL=navbar-brand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-brand.d.ts","sourceRoot":"","sources":["../../../src/navbar/navbar-brand.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,WAAW,gBAAiB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAA;CAC/C;AAED,eAAO,MAAM,WAAW,4FAiBtB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HtmlUiProps } from "../system/types";
|
|
2
|
+
export interface NavbarContentProps extends HtmlUiProps<"ul"> {
|
|
3
|
+
/**
|
|
4
|
+
* The content of the Navbar.Content. It is usually the `NavbarItem`,
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
7
|
+
/**
|
|
8
|
+
* The justify of the content
|
|
9
|
+
* @default start
|
|
10
|
+
*/
|
|
11
|
+
justify?: "start" | "end" | "center";
|
|
12
|
+
}
|
|
13
|
+
export declare const NavbarContent: import("../system/utils").InternalForwardRefRenderFunction<"div", NavbarContentProps, never>;
|
|
14
|
+
//# sourceMappingURL=navbar-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-content.d.ts","sourceRoot":"","sources":["../../../src/navbar/navbar-content.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,WAAW,kBAAmB,SAAQ,WAAW,CAAC,IAAI,CAAC;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAA;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;CACrC;AAED,eAAO,MAAM,aAAa,8FAsBzB,CAAA"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export declare const NavbarProvider: import("react").Context<{
|
|
2
|
+
Component: import("../system/types").As<any>;
|
|
3
|
+
slots: {
|
|
4
|
+
base: (slotProps?: ({
|
|
5
|
+
position?: "static" | "sticky" | undefined;
|
|
6
|
+
hasBorder?: boolean | undefined;
|
|
7
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
8
|
+
wrapper: (slotProps?: ({
|
|
9
|
+
position?: "static" | "sticky" | undefined;
|
|
10
|
+
hasBorder?: boolean | undefined;
|
|
11
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
12
|
+
toggle: (slotProps?: ({
|
|
13
|
+
position?: "static" | "sticky" | undefined;
|
|
14
|
+
hasBorder?: boolean | undefined;
|
|
15
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
16
|
+
toggleIcon: (slotProps?: ({
|
|
17
|
+
position?: "static" | "sticky" | undefined;
|
|
18
|
+
hasBorder?: boolean | undefined;
|
|
19
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
20
|
+
brand: (slotProps?: ({
|
|
21
|
+
position?: "static" | "sticky" | undefined;
|
|
22
|
+
hasBorder?: boolean | undefined;
|
|
23
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
24
|
+
content: (slotProps?: ({
|
|
25
|
+
position?: "static" | "sticky" | undefined;
|
|
26
|
+
hasBorder?: boolean | undefined;
|
|
27
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
28
|
+
item: (slotProps?: ({
|
|
29
|
+
position?: "static" | "sticky" | undefined;
|
|
30
|
+
hasBorder?: boolean | undefined;
|
|
31
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
32
|
+
menu: (slotProps?: ({
|
|
33
|
+
position?: "static" | "sticky" | undefined;
|
|
34
|
+
hasBorder?: boolean | undefined;
|
|
35
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
36
|
+
menuItem: (slotProps?: ({
|
|
37
|
+
position?: "static" | "sticky" | undefined;
|
|
38
|
+
hasBorder?: boolean | undefined;
|
|
39
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
40
|
+
} & {
|
|
41
|
+
base: (slotProps?: ({
|
|
42
|
+
position?: "static" | "sticky" | undefined;
|
|
43
|
+
hasBorder?: boolean | undefined;
|
|
44
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
45
|
+
wrapper: (slotProps?: ({
|
|
46
|
+
position?: "static" | "sticky" | undefined;
|
|
47
|
+
hasBorder?: boolean | undefined;
|
|
48
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
49
|
+
toggle: (slotProps?: ({
|
|
50
|
+
position?: "static" | "sticky" | undefined;
|
|
51
|
+
hasBorder?: boolean | undefined;
|
|
52
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
53
|
+
toggleIcon: (slotProps?: ({
|
|
54
|
+
position?: "static" | "sticky" | undefined;
|
|
55
|
+
hasBorder?: boolean | undefined;
|
|
56
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
57
|
+
brand: (slotProps?: ({
|
|
58
|
+
position?: "static" | "sticky" | undefined;
|
|
59
|
+
hasBorder?: boolean | undefined;
|
|
60
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
61
|
+
content: (slotProps?: ({
|
|
62
|
+
position?: "static" | "sticky" | undefined;
|
|
63
|
+
hasBorder?: boolean | undefined;
|
|
64
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
65
|
+
item: (slotProps?: ({
|
|
66
|
+
position?: "static" | "sticky" | undefined;
|
|
67
|
+
hasBorder?: boolean | undefined;
|
|
68
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
69
|
+
menu: (slotProps?: ({
|
|
70
|
+
position?: "static" | "sticky" | undefined;
|
|
71
|
+
hasBorder?: boolean | undefined;
|
|
72
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
73
|
+
menuItem: (slotProps?: ({
|
|
74
|
+
position?: "static" | "sticky" | undefined;
|
|
75
|
+
hasBorder?: boolean | undefined;
|
|
76
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
77
|
+
} & {};
|
|
78
|
+
domRef: import("react").RefObject<HTMLElement | null>;
|
|
79
|
+
menuTopOffset: number;
|
|
80
|
+
menuTopOffsetPx: string;
|
|
81
|
+
isNavbarHidden: boolean;
|
|
82
|
+
shouldShowOnScrollUp: boolean;
|
|
83
|
+
isMenuOpen: boolean;
|
|
84
|
+
classNames: import("@opengovsg/oui-theme").SlotsToClasses<"toggle" | "content" | "base" | "wrapper" | "item" | "brand" | "menu" | "menuItem" | "toggleIcon"> | undefined;
|
|
85
|
+
setIsMenuOpen: (value: boolean, ...args: any[]) => void;
|
|
86
|
+
menuRef: import("react").RefObject<HTMLButtonElement | null>;
|
|
87
|
+
getBaseProps: import("../system/types").PropGetter;
|
|
88
|
+
getWrapperProps: import("../system/types").PropGetter;
|
|
89
|
+
position: "static" | "sticky";
|
|
90
|
+
motionProps: Omit<import("motion/react").HTMLMotionProps<"nav">, "ref"> | undefined;
|
|
91
|
+
}>, useNavbarContext: () => {
|
|
92
|
+
Component: import("../system/types").As<any>;
|
|
93
|
+
slots: {
|
|
94
|
+
base: (slotProps?: ({
|
|
95
|
+
position?: "static" | "sticky" | undefined;
|
|
96
|
+
hasBorder?: boolean | undefined;
|
|
97
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
98
|
+
wrapper: (slotProps?: ({
|
|
99
|
+
position?: "static" | "sticky" | undefined;
|
|
100
|
+
hasBorder?: boolean | undefined;
|
|
101
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
102
|
+
toggle: (slotProps?: ({
|
|
103
|
+
position?: "static" | "sticky" | undefined;
|
|
104
|
+
hasBorder?: boolean | undefined;
|
|
105
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
106
|
+
toggleIcon: (slotProps?: ({
|
|
107
|
+
position?: "static" | "sticky" | undefined;
|
|
108
|
+
hasBorder?: boolean | undefined;
|
|
109
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
110
|
+
brand: (slotProps?: ({
|
|
111
|
+
position?: "static" | "sticky" | undefined;
|
|
112
|
+
hasBorder?: boolean | undefined;
|
|
113
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
114
|
+
content: (slotProps?: ({
|
|
115
|
+
position?: "static" | "sticky" | undefined;
|
|
116
|
+
hasBorder?: boolean | undefined;
|
|
117
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
118
|
+
item: (slotProps?: ({
|
|
119
|
+
position?: "static" | "sticky" | undefined;
|
|
120
|
+
hasBorder?: boolean | undefined;
|
|
121
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
122
|
+
menu: (slotProps?: ({
|
|
123
|
+
position?: "static" | "sticky" | undefined;
|
|
124
|
+
hasBorder?: boolean | undefined;
|
|
125
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
126
|
+
menuItem: (slotProps?: ({
|
|
127
|
+
position?: "static" | "sticky" | undefined;
|
|
128
|
+
hasBorder?: boolean | undefined;
|
|
129
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
130
|
+
} & {
|
|
131
|
+
base: (slotProps?: ({
|
|
132
|
+
position?: "static" | "sticky" | undefined;
|
|
133
|
+
hasBorder?: boolean | undefined;
|
|
134
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
135
|
+
wrapper: (slotProps?: ({
|
|
136
|
+
position?: "static" | "sticky" | undefined;
|
|
137
|
+
hasBorder?: boolean | undefined;
|
|
138
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
139
|
+
toggle: (slotProps?: ({
|
|
140
|
+
position?: "static" | "sticky" | undefined;
|
|
141
|
+
hasBorder?: boolean | undefined;
|
|
142
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
143
|
+
toggleIcon: (slotProps?: ({
|
|
144
|
+
position?: "static" | "sticky" | undefined;
|
|
145
|
+
hasBorder?: boolean | undefined;
|
|
146
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
147
|
+
brand: (slotProps?: ({
|
|
148
|
+
position?: "static" | "sticky" | undefined;
|
|
149
|
+
hasBorder?: boolean | undefined;
|
|
150
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
151
|
+
content: (slotProps?: ({
|
|
152
|
+
position?: "static" | "sticky" | undefined;
|
|
153
|
+
hasBorder?: boolean | undefined;
|
|
154
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
155
|
+
item: (slotProps?: ({
|
|
156
|
+
position?: "static" | "sticky" | undefined;
|
|
157
|
+
hasBorder?: boolean | undefined;
|
|
158
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
159
|
+
menu: (slotProps?: ({
|
|
160
|
+
position?: "static" | "sticky" | undefined;
|
|
161
|
+
hasBorder?: boolean | undefined;
|
|
162
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
163
|
+
menuItem: (slotProps?: ({
|
|
164
|
+
position?: "static" | "sticky" | undefined;
|
|
165
|
+
hasBorder?: boolean | undefined;
|
|
166
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
167
|
+
} & {};
|
|
168
|
+
domRef: import("react").RefObject<HTMLElement | null>;
|
|
169
|
+
menuTopOffset: number;
|
|
170
|
+
menuTopOffsetPx: string;
|
|
171
|
+
isNavbarHidden: boolean;
|
|
172
|
+
shouldShowOnScrollUp: boolean;
|
|
173
|
+
isMenuOpen: boolean;
|
|
174
|
+
classNames: import("@opengovsg/oui-theme").SlotsToClasses<"toggle" | "content" | "base" | "wrapper" | "item" | "brand" | "menu" | "menuItem" | "toggleIcon"> | undefined;
|
|
175
|
+
setIsMenuOpen: (value: boolean, ...args: any[]) => void;
|
|
176
|
+
menuRef: import("react").RefObject<HTMLButtonElement | null>;
|
|
177
|
+
getBaseProps: import("../system/types").PropGetter;
|
|
178
|
+
getWrapperProps: import("../system/types").PropGetter;
|
|
179
|
+
position: "static" | "sticky";
|
|
180
|
+
motionProps: Omit<import("motion/react").HTMLMotionProps<"nav">, "ref"> | undefined;
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=navbar-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-context.d.ts","sourceRoot":"","sources":["../../../src/navbar/navbar-context.ts"],"names":[],"mappings":"AAKA,eAAO,MAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM1C,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HtmlUiProps } from "../system/types";
|
|
2
|
+
export interface NavbarItemProps extends HtmlUiProps<"li"> {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Whether the item is active or not.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const NavbarItem: import("../system/utils").InternalForwardRefRenderFunction<"div", NavbarItemProps, never>;
|
|
11
|
+
//# sourceMappingURL=navbar-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-item.d.ts","sourceRoot":"","sources":["../../../src/navbar/navbar-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,WAAW,eAAgB,SAAQ,WAAW,CAAC,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,UAAU,2FAkBrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/navbar/navbar-menu/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,eAAO,MAAM,WAAW,EAAE,gBAiBzB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClassNameOrFunction } from "@opengovsg/oui-theme";
|
|
2
|
+
import type { HtmlUiProps } from "../../system/types";
|
|
3
|
+
export interface NavbarMenuItemRenderProps {
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface NavbarMenuItemProps extends Omit<HtmlUiProps<"li">, "className"> {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the item is active or not.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
className?: ClassNameOrFunction<NavbarMenuItemRenderProps>;
|
|
14
|
+
}
|
|
15
|
+
export declare const NavbarMenuItem: import("../../system/utils").InternalForwardRefRenderFunction<"li", NavbarMenuItemProps, never>;
|
|
16
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/navbar/navbar-menu/item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAKrD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,CAAA;CAC3D;AAED,eAAO,MAAM,cAAc,iGAgC1B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HtmlUiProps } from "../../system/types";
|
|
2
|
+
export interface NavbarMenuProps extends HtmlUiProps<"ul"> {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* The container element in which the navbar menu overlay portal will be placed.
|
|
6
|
+
* @default below the navbar element
|
|
7
|
+
*/
|
|
8
|
+
portalContainer?: Element;
|
|
9
|
+
}
|
|
10
|
+
export declare const NavbarMenu: import("../../system/utils").InternalForwardRefRenderFunction<"ul", NavbarMenuProps, never>;
|
|
11
|
+
//# sourceMappingURL=menu.d.ts.map
|