@flipdish/ui-library 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +338 -0
- package/dist/components/atoms/Avatar/avatar.utils.d.ts +10 -0
- package/dist/components/atoms/Avatar/avatar.utils.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-add-button.d.ts +9 -0
- package/dist/components/atoms/Avatar/components/avatar-add-button.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-company-icon.d.ts +8 -0
- package/dist/components/atoms/Avatar/components/avatar-company-icon.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-count.cjs +9 -0
- package/dist/components/atoms/Avatar/components/avatar-count.cjs.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-count.d.ts +7 -0
- package/dist/components/atoms/Avatar/components/avatar-count.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-count.js +7 -0
- package/dist/components/atoms/Avatar/components/avatar-count.js.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.cjs +21 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.cjs.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.d.ts +8 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.js +19 -0
- package/dist/components/atoms/Avatar/components/avatar-online-indicator.js.map +1 -0
- package/dist/components/atoms/Avatar/components/verified-tick.cjs +21 -0
- package/dist/components/atoms/Avatar/components/verified-tick.cjs.map +1 -0
- package/dist/components/atoms/Avatar/components/verified-tick.d.ts +7 -0
- package/dist/components/atoms/Avatar/components/verified-tick.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/components/verified-tick.js +19 -0
- package/dist/components/atoms/Avatar/components/verified-tick.js.map +1 -0
- package/dist/components/atoms/Avatar/index.cjs +54 -0
- package/dist/components/atoms/Avatar/index.cjs.map +1 -0
- package/dist/components/atoms/Avatar/index.d.ts +65 -0
- package/dist/components/atoms/Avatar/index.d.ts.map +1 -0
- package/dist/components/atoms/Avatar/index.js +52 -0
- package/dist/components/atoms/Avatar/index.js.map +1 -0
- package/dist/components/atoms/Badge/badge.types.cjs +10 -0
- package/dist/components/atoms/Badge/badge.types.cjs.map +1 -0
- package/dist/components/atoms/Badge/badge.types.d.ts +22 -0
- package/dist/components/atoms/Badge/badge.types.d.ts.map +1 -0
- package/dist/components/atoms/Badge/badge.types.js +8 -0
- package/dist/components/atoms/Badge/badge.types.js.map +1 -0
- package/dist/components/atoms/Badge/index.cjs +274 -0
- package/dist/components/atoms/Badge/index.cjs.map +1 -0
- package/dist/components/atoms/Badge/index.d.ts +129 -0
- package/dist/components/atoms/Badge/index.d.ts.map +1 -0
- package/dist/components/atoms/Badge/index.js +265 -0
- package/dist/components/atoms/Badge/index.js.map +1 -0
- package/dist/components/atoms/Button/index.cjs +164 -0
- package/dist/components/atoms/Button/index.cjs.map +1 -0
- package/dist/components/atoms/Button/index.d.ts +111 -0
- package/dist/components/atoms/Button/index.d.ts.map +1 -0
- package/dist/components/atoms/Button/index.js +161 -0
- package/dist/components/atoms/Button/index.js.map +1 -0
- package/dist/components/atoms/Checkbox/index.cjs +35 -0
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -0
- package/dist/components/atoms/Checkbox/index.d.ts +26 -0
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -0
- package/dist/components/atoms/Checkbox/index.js +32 -0
- package/dist/components/atoms/Checkbox/index.js.map +1 -0
- package/dist/components/atoms/Divider/index.cjs +17 -0
- package/dist/components/atoms/Divider/index.cjs.map +1 -0
- package/dist/components/atoms/Divider/index.d.ts +17 -0
- package/dist/components/atoms/Divider/index.d.ts.map +1 -0
- package/dist/components/atoms/Divider/index.js +15 -0
- package/dist/components/atoms/Divider/index.js.map +1 -0
- package/dist/components/atoms/Dot/index.cjs +29 -0
- package/dist/components/atoms/Dot/index.cjs.map +1 -0
- package/dist/components/atoms/Dot/index.d.ts +10 -0
- package/dist/components/atoms/Dot/index.d.ts.map +1 -0
- package/dist/components/atoms/Dot/index.js +27 -0
- package/dist/components/atoms/Dot/index.js.map +1 -0
- package/dist/components/atoms/FeaturedIcon/index.cjs +122 -0
- package/dist/components/atoms/FeaturedIcon/index.cjs.map +1 -0
- package/dist/components/atoms/FeaturedIcon/index.d.ts +15 -0
- package/dist/components/atoms/FeaturedIcon/index.d.ts.map +1 -0
- package/dist/components/atoms/FeaturedIcon/index.js +120 -0
- package/dist/components/atoms/FeaturedIcon/index.js.map +1 -0
- package/dist/components/atoms/Input/components/hint-text.cjs +17 -0
- package/dist/components/atoms/Input/components/hint-text.cjs.map +1 -0
- package/dist/components/atoms/Input/components/hint-text.d.ts +15 -0
- package/dist/components/atoms/Input/components/hint-text.d.ts.map +1 -0
- package/dist/components/atoms/Input/components/hint-text.js +15 -0
- package/dist/components/atoms/Input/components/hint-text.js.map +1 -0
- package/dist/components/atoms/Input/components/label.cjs +28 -0
- package/dist/components/atoms/Input/components/label.cjs.map +1 -0
- package/dist/components/atoms/Input/components/label.d.ts +16 -0
- package/dist/components/atoms/Input/components/label.d.ts.map +1 -0
- package/dist/components/atoms/Input/components/label.js +26 -0
- package/dist/components/atoms/Input/components/label.js.map +1 -0
- package/dist/components/atoms/Input/index.cjs +78 -0
- package/dist/components/atoms/Input/index.cjs.map +1 -0
- package/dist/components/atoms/Input/index.d.ts +60 -0
- package/dist/components/atoms/Input/index.d.ts.map +1 -0
- package/dist/components/atoms/Input/index.js +72 -0
- package/dist/components/atoms/Input/index.js.map +1 -0
- package/dist/components/atoms/LoadingIndicator/index.cjs +54 -0
- package/dist/components/atoms/LoadingIndicator/index.cjs.map +1 -0
- package/dist/components/atoms/LoadingIndicator/index.d.ts +24 -0
- package/dist/components/atoms/LoadingIndicator/index.d.ts.map +1 -0
- package/dist/components/atoms/LoadingIndicator/index.js +52 -0
- package/dist/components/atoms/LoadingIndicator/index.js.map +1 -0
- package/dist/components/atoms/RadioButton/index.cjs +43 -0
- package/dist/components/atoms/RadioButton/index.cjs.map +1 -0
- package/dist/components/atoms/RadioButton/index.d.ts +33 -0
- package/dist/components/atoms/RadioButton/index.d.ts.map +1 -0
- package/dist/components/atoms/RadioButton/index.js +39 -0
- package/dist/components/atoms/RadioButton/index.js.map +1 -0
- package/dist/components/atoms/Toggle/index.cjs +63 -0
- package/dist/components/atoms/Toggle/index.cjs.map +1 -0
- package/dist/components/atoms/Toggle/index.d.ts +26 -0
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -0
- package/dist/components/atoms/Toggle/index.js +60 -0
- package/dist/components/atoms/Toggle/index.js.map +1 -0
- package/dist/components/atoms/Tooltip/index.cjs +22 -0
- package/dist/components/atoms/Tooltip/index.cjs.map +1 -0
- package/dist/components/atoms/Tooltip/index.d.ts +30 -0
- package/dist/components/atoms/Tooltip/index.d.ts.map +1 -0
- package/dist/components/atoms/Tooltip/index.js +19 -0
- package/dist/components/atoms/Tooltip/index.js.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs +22 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts +13 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js +20 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs +44 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts +19 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js +42 -0
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js.map +1 -0
- package/dist/components/molecules/Breadcrumbs/index.cjs +38 -0
- package/dist/components/molecules/Breadcrumbs/index.cjs.map +1 -0
- package/dist/components/molecules/Breadcrumbs/index.d.ts +25 -0
- package/dist/components/molecules/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumbs/index.js +35 -0
- package/dist/components/molecules/Breadcrumbs/index.js.map +1 -0
- package/dist/components/molecules/ButtonGroup/index.cjs +64 -0
- package/dist/components/molecules/ButtonGroup/index.cjs.map +1 -0
- package/dist/components/molecules/ButtonGroup/index.d.ts +51 -0
- package/dist/components/molecules/ButtonGroup/index.d.ts.map +1 -0
- package/dist/components/molecules/ButtonGroup/index.js +60 -0
- package/dist/components/molecules/ButtonGroup/index.js.map +1 -0
- package/dist/components/molecules/Dropdown/index.cjs +66 -0
- package/dist/components/molecules/Dropdown/index.cjs.map +1 -0
- package/dist/components/molecules/Dropdown/index.d.ts +39 -0
- package/dist/components/molecules/Dropdown/index.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/index.js +64 -0
- package/dist/components/molecules/Dropdown/index.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs +14 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts +16 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js +12 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs +13 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts +9 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js +11 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs +15 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts +21 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js +13 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs +14 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts +9 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js +12 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs +14 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts +16 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js +12 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs +12 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts +9 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js +10 -0
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js.map +1 -0
- package/dist/components/molecules/RadioGroup/index.cjs +18 -0
- package/dist/components/molecules/RadioGroup/index.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/index.d.ts +7 -0
- package/dist/components/molecules/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/index.js +7 -0
- package/dist/components/molecules/RadioGroup/index.js.map +1 -0
- package/dist/components/molecules/RadioGroup/radioGroup.types.d.ts +12 -0
- package/dist/components/molecules/RadioGroup/radioGroup.types.d.ts.map +1 -0
- package/dist/components/molecules/SectionHeader/index.cjs +20 -0
- package/dist/components/molecules/SectionHeader/index.cjs.map +1 -0
- package/dist/components/molecules/SectionHeader/index.d.ts +9 -0
- package/dist/components/molecules/SectionHeader/index.d.ts.map +1 -0
- package/dist/components/molecules/SectionHeader/index.js +18 -0
- package/dist/components/molecules/SectionHeader/index.js.map +1 -0
- package/dist/components/molecules/Select/components/combobox.cjs +47 -0
- package/dist/components/molecules/Select/components/combobox.cjs.map +1 -0
- package/dist/components/molecules/Select/components/combobox.d.ts +15 -0
- package/dist/components/molecules/Select/components/combobox.d.ts.map +1 -0
- package/dist/components/molecules/Select/components/combobox.js +45 -0
- package/dist/components/molecules/Select/components/combobox.js.map +1 -0
- package/dist/components/molecules/Select/components/popover.cjs +14 -0
- package/dist/components/molecules/Select/components/popover.cjs.map +1 -0
- package/dist/components/molecules/Select/components/popover.d.ts +8 -0
- package/dist/components/molecules/Select/components/popover.d.ts.map +1 -0
- package/dist/components/molecules/Select/components/popover.js +12 -0
- package/dist/components/molecules/Select/components/popover.js.map +1 -0
- package/dist/components/molecules/Select/components/select-item.cjs +54 -0
- package/dist/components/molecules/Select/components/select-item.cjs.map +1 -0
- package/dist/components/molecules/Select/components/select-item.d.ts +11 -0
- package/dist/components/molecules/Select/components/select-item.d.ts.map +1 -0
- package/dist/components/molecules/Select/components/select-item.js +52 -0
- package/dist/components/molecules/Select/components/select-item.js.map +1 -0
- package/dist/components/molecules/Select/components/select-shared.cjs +20 -0
- package/dist/components/molecules/Select/components/select-shared.cjs.map +1 -0
- package/dist/components/molecules/Select/components/select-shared.d.ts +59 -0
- package/dist/components/molecules/Select/components/select-shared.d.ts.map +1 -0
- package/dist/components/molecules/Select/components/select-shared.js +17 -0
- package/dist/components/molecules/Select/components/select-shared.js.map +1 -0
- package/dist/components/molecules/Select/index.cjs +37 -0
- package/dist/components/molecules/Select/index.cjs.map +1 -0
- package/dist/components/molecules/Select/index.d.ts +19 -0
- package/dist/components/molecules/Select/index.d.ts.map +1 -0
- package/dist/components/molecules/Select/index.js +33 -0
- package/dist/components/molecules/Select/index.js.map +1 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.cjs +14 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.cjs.map +1 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.d.ts +24 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.d.ts.map +1 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.js +12 -0
- package/dist/components/organisms/PageHeader/components/page-header-simple.js.map +1 -0
- package/dist/components/organisms/PageHeader/index.cjs +8 -0
- package/dist/components/organisms/PageHeader/index.cjs.map +1 -0
- package/dist/components/organisms/PageHeader/index.d.ts +7 -0
- package/dist/components/organisms/PageHeader/index.d.ts.map +1 -0
- package/dist/components/organisms/PageHeader/index.js +2 -0
- package/dist/components/organisms/PageHeader/index.js.map +1 -0
- package/dist/components/templates/NotFoundPage/index.cjs +19 -0
- package/dist/components/templates/NotFoundPage/index.cjs.map +1 -0
- package/dist/components/templates/NotFoundPage/index.d.ts +25 -0
- package/dist/components/templates/NotFoundPage/index.d.ts.map +1 -0
- package/dist/components/templates/NotFoundPage/index.js +17 -0
- package/dist/components/templates/NotFoundPage/index.js.map +1 -0
- package/dist/components/templates/PageLayout/index.cjs +30 -0
- package/dist/components/templates/PageLayout/index.cjs.map +1 -0
- package/dist/components/templates/PageLayout/index.d.ts +43 -0
- package/dist/components/templates/PageLayout/index.d.ts.map +1 -0
- package/dist/components/templates/PageLayout/index.js +28 -0
- package/dist/components/templates/PageLayout/index.js.map +1 -0
- package/dist/hooks/useResizeObserver/index.cjs +47 -0
- package/dist/hooks/useResizeObserver/index.cjs.map +1 -0
- package/dist/hooks/useResizeObserver/index.d.ts +25 -0
- package/dist/hooks/useResizeObserver/index.d.ts.map +1 -0
- package/dist/hooks/useResizeObserver/index.js +45 -0
- package/dist/hooks/useResizeObserver/index.js.map +1 -0
- package/dist/providers/ErrorBoundary/index.cjs +36 -0
- package/dist/providers/ErrorBoundary/index.cjs.map +1 -0
- package/dist/providers/ErrorBoundary/index.d.ts +32 -0
- package/dist/providers/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/providers/ErrorBoundary/index.js +34 -0
- package/dist/providers/ErrorBoundary/index.js.map +1 -0
- package/dist/src/components/atoms/Avatar/avatar.utils.d.ts +10 -0
- package/dist/src/components/atoms/Avatar/avatar.utils.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/components/avatar-add-button.d.ts +9 -0
- package/dist/src/components/atoms/Avatar/components/avatar-add-button.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/components/avatar-company-icon.d.ts +8 -0
- package/dist/src/components/atoms/Avatar/components/avatar-company-icon.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/components/avatar-count.d.ts +7 -0
- package/dist/src/components/atoms/Avatar/components/avatar-count.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/components/avatar-online-indicator.d.ts +8 -0
- package/dist/src/components/atoms/Avatar/components/avatar-online-indicator.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/components/verified-tick.d.ts +7 -0
- package/dist/src/components/atoms/Avatar/components/verified-tick.d.ts.map +1 -0
- package/dist/src/components/atoms/Avatar/index.d.ts +65 -0
- package/dist/src/components/atoms/Avatar/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Badge/badge.types.d.ts +22 -0
- package/dist/src/components/atoms/Badge/badge.types.d.ts.map +1 -0
- package/dist/src/components/atoms/Badge/index.d.ts +129 -0
- package/dist/src/components/atoms/Badge/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Button/index.d.ts +111 -0
- package/dist/src/components/atoms/Button/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Checkbox/index.d.ts +26 -0
- package/dist/src/components/atoms/Checkbox/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Divider/index.d.ts +17 -0
- package/dist/src/components/atoms/Divider/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Dot/index.d.ts +5 -0
- package/dist/src/components/atoms/Dot/index.d.ts.map +1 -0
- package/dist/src/components/atoms/FeaturedIcon/index.d.ts +15 -0
- package/dist/src/components/atoms/FeaturedIcon/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Input/components/hint-text.d.ts +15 -0
- package/dist/src/components/atoms/Input/components/hint-text.d.ts.map +1 -0
- package/dist/src/components/atoms/Input/components/label.d.ts +16 -0
- package/dist/src/components/atoms/Input/components/label.d.ts.map +1 -0
- package/dist/src/components/atoms/Input/index.d.ts +60 -0
- package/dist/src/components/atoms/Input/index.d.ts.map +1 -0
- package/dist/src/components/atoms/LoadingIndicator/index.d.ts +19 -0
- package/dist/src/components/atoms/LoadingIndicator/index.d.ts.map +1 -0
- package/dist/src/components/atoms/RadioButton/index.d.ts +33 -0
- package/dist/src/components/atoms/RadioButton/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Toggle/index.d.ts +21 -0
- package/dist/src/components/atoms/Toggle/index.d.ts.map +1 -0
- package/dist/src/components/atoms/Tooltip/index.d.ts +30 -0
- package/dist/src/components/atoms/Tooltip/index.d.ts.map +1 -0
- package/dist/src/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts +13 -0
- package/dist/src/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts.map +1 -0
- package/dist/src/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts +19 -0
- package/dist/src/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts.map +1 -0
- package/dist/src/components/molecules/Breadcrumbs/index.d.ts +25 -0
- package/dist/src/components/molecules/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/src/components/molecules/ButtonGroup/index.d.ts +41 -0
- package/dist/src/components/molecules/ButtonGroup/index.d.ts.map +1 -0
- package/dist/src/components/molecules/Dropdown/index.d.ts +35 -0
- package/dist/src/components/molecules/Dropdown/index.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-avatar.d.ts +16 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-avatar.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts +9 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts +21 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts +19 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts +16 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts +9 -0
- package/dist/src/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/index.d.ts +7 -0
- package/dist/src/components/molecules/RadioGroup/index.d.ts.map +1 -0
- package/dist/src/components/molecules/RadioGroup/radioGroup.types.d.ts +12 -0
- package/dist/src/components/molecules/RadioGroup/radioGroup.types.d.ts.map +1 -0
- package/dist/src/components/molecules/SectionHeader/index.d.ts +9 -0
- package/dist/src/components/molecules/SectionHeader/index.d.ts.map +1 -0
- package/dist/src/components/molecules/Select/components/combobox.d.ts +15 -0
- package/dist/src/components/molecules/Select/components/combobox.d.ts.map +1 -0
- package/dist/src/components/molecules/Select/components/popover.d.ts +8 -0
- package/dist/src/components/molecules/Select/components/popover.d.ts.map +1 -0
- package/dist/src/components/molecules/Select/components/select-item.d.ts +11 -0
- package/dist/src/components/molecules/Select/components/select-item.d.ts.map +1 -0
- package/dist/src/components/molecules/Select/components/select-shared.d.ts +59 -0
- package/dist/src/components/molecules/Select/components/select-shared.d.ts.map +1 -0
- package/dist/src/components/molecules/Select/index.d.ts +19 -0
- package/dist/src/components/molecules/Select/index.d.ts.map +1 -0
- package/dist/src/components/organisms/PageHeader/components/page-header-simple.d.ts +24 -0
- package/dist/src/components/organisms/PageHeader/components/page-header-simple.d.ts.map +1 -0
- package/dist/src/components/organisms/PageHeader/index.d.ts +2 -0
- package/dist/src/components/organisms/PageHeader/index.d.ts.map +1 -0
- package/dist/src/components/templates/NotFoundPage/index.d.ts +25 -0
- package/dist/src/components/templates/NotFoundPage/index.d.ts.map +1 -0
- package/dist/src/components/templates/PageLayout/index.d.ts +43 -0
- package/dist/src/components/templates/PageLayout/index.d.ts.map +1 -0
- package/dist/src/hooks/useResizeObserver/index.d.ts +25 -0
- package/dist/src/hooks/useResizeObserver/index.d.ts.map +1 -0
- package/dist/src/providers/ErrorBoundary/index.d.ts +32 -0
- package/dist/src/providers/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/src/utilities/cx/index.d.ts +22 -0
- package/dist/src/utilities/cx/index.d.ts.map +1 -0
- package/dist/src/utilities/isReactComponent/index.d.ts +24 -0
- package/dist/src/utilities/isReactComponent/index.d.ts.map +1 -0
- package/dist/src/utilities/renderUtils/index.d.ts +56 -0
- package/dist/src/utilities/renderUtils/index.d.ts.map +1 -0
- package/dist/styles.css +101 -0
- package/dist/utilities/cx/index.cjs +41 -0
- package/dist/utilities/cx/index.cjs.map +1 -0
- package/dist/utilities/cx/index.d.ts +22 -0
- package/dist/utilities/cx/index.d.ts.map +1 -0
- package/dist/utilities/cx/index.js +38 -0
- package/dist/utilities/cx/index.js.map +1 -0
- package/dist/utilities/isReactComponent/index.cjs +40 -0
- package/dist/utilities/isReactComponent/index.cjs.map +1 -0
- package/dist/utilities/isReactComponent/index.d.ts +24 -0
- package/dist/utilities/isReactComponent/index.d.ts.map +1 -0
- package/dist/utilities/isReactComponent/index.js +35 -0
- package/dist/utilities/isReactComponent/index.js.map +1 -0
- package/dist/utilities/renderUtils/index.cjs +122 -0
- package/dist/utilities/renderUtils/index.cjs.map +1 -0
- package/dist/utilities/renderUtils/index.d.ts +56 -0
- package/dist/utilities/renderUtils/index.d.ts.map +1 -0
- package/dist/utilities/renderUtils/index.js +114 -0
- package/dist/utilities/renderUtils/index.js.map +1 -0
- package/package.json +135 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode, SVGProps } from 'react';
|
|
2
|
+
export type SelectItemType = {
|
|
3
|
+
/** Unique identifier for the item. */
|
|
4
|
+
id: string | number;
|
|
5
|
+
/** The primary display text. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Avatar image URL. */
|
|
8
|
+
avatarUrl?: string;
|
|
9
|
+
/** Whether the item is disabled. */
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
/** Secondary text displayed alongside the label. */
|
|
12
|
+
supportingText?: string;
|
|
13
|
+
/** Leading icon component or element. */
|
|
14
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>> | ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export interface CommonProps {
|
|
17
|
+
/** Helper text displayed below the input. */
|
|
18
|
+
hint?: string;
|
|
19
|
+
/** Field label displayed above the input. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Tooltip text for the help icon next to the label. */
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The size of the component.
|
|
25
|
+
* @default "md"
|
|
26
|
+
*/
|
|
27
|
+
size?: 'sm' | 'md' | 'lg';
|
|
28
|
+
/** Placeholder text when no value is selected. */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** Whether to hide the required indicator from the label. */
|
|
31
|
+
hideRequiredIndicator?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const sizes: {
|
|
34
|
+
sm: {
|
|
35
|
+
root: string;
|
|
36
|
+
withIcon: string;
|
|
37
|
+
text: string;
|
|
38
|
+
textContainer: string;
|
|
39
|
+
shortcut: string;
|
|
40
|
+
};
|
|
41
|
+
md: {
|
|
42
|
+
root: string;
|
|
43
|
+
withIcon: string;
|
|
44
|
+
text: string;
|
|
45
|
+
textContainer: string;
|
|
46
|
+
shortcut: string;
|
|
47
|
+
};
|
|
48
|
+
lg: {
|
|
49
|
+
root: string;
|
|
50
|
+
withIcon: string;
|
|
51
|
+
text: string;
|
|
52
|
+
textContainer: string;
|
|
53
|
+
shortcut: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare const SelectContext: import("react").Context<{
|
|
57
|
+
size: "sm" | "md" | "lg";
|
|
58
|
+
}>;
|
|
59
|
+
//# sourceMappingURL=select-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-shared.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Select/components/select-shared.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGhE,MAAM,MAAM,cAAc,GAAG;IAC3B,sCAAsC;IACtC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAC;AAEF,eAAO,MAAM,aAAa;UAAyB,IAAI,GAAG,IAAI,GAAG,IAAI;EAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const sizes = {
|
|
4
|
+
sm: {
|
|
5
|
+
root: 'py-2 pl-3 pr-2.5 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]',
|
|
6
|
+
withIcon: '',
|
|
7
|
+
text: 'text-sm',
|
|
8
|
+
textContainer: 'gap-x-1.5',
|
|
9
|
+
shortcut: 'pr-2.5',
|
|
10
|
+
},
|
|
11
|
+
md: { root: 'py-2 px-3 gap-2 *:data-icon:size-5', withIcon: '', text: 'text-md', textContainer: 'gap-x-1.5', shortcut: 'pr-2.5' },
|
|
12
|
+
lg: { root: 'py-2.5 px-3.5 gap-2 *:data-icon:size-5', withIcon: '', text: 'text-md', textContainer: 'gap-x-1.5', shortcut: 'pr-3' },
|
|
13
|
+
};
|
|
14
|
+
const SelectContext = createContext({ size: 'md' });
|
|
15
|
+
|
|
16
|
+
export { SelectContext, sizes };
|
|
17
|
+
//# sourceMappingURL=select-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-shared.js","sources":["../../../../../src/components/molecules/Select/components/select-shared.tsx"],"sourcesContent":[null],"names":[],"mappings":";;AAsCO,MAAM,KAAK,GAAG;AACnB,IAAA,EAAE,EAAE;AACF,QAAA,IAAI,EAAE,uEAAuE;AAC7E,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,aAAa,EAAE,WAAW;AAC1B,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;IACD,EAAE,EAAE,EAAE,IAAI,EAAE,oCAAoC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE;IACjI,EAAE,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE;;AAG9H,MAAM,aAAa,GAAG,aAAa,CAA+B,EAAE,IAAI,EAAE,IAAI,EAAE;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
+
var Avatar = require('@flipdish/ui-library/components/atoms/Avatar');
|
|
6
|
+
var Input = require('@flipdish/ui-library/components/atoms/Input');
|
|
7
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
8
|
+
var isReactComponent = require('@flipdish/ui-library/utilities/isReactComponent');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var reactAriaComponents = require('react-aria-components');
|
|
11
|
+
var combobox = require('./components/combobox.cjs');
|
|
12
|
+
var popover = require('./components/popover.cjs');
|
|
13
|
+
var selectItem = require('./components/select-item.cjs');
|
|
14
|
+
var selectShared = require('./components/select-shared.cjs');
|
|
15
|
+
|
|
16
|
+
const SelectValue = ({ isOpen, isFocused, isDisabled, size, placeholder, icon, ref }) => {
|
|
17
|
+
return (jsxRuntime.jsx(reactAriaComponents.Button, { ref: ref, className: cx.cx('relative flex w-full cursor-pointer items-center rounded-lg bg-primary shadow-xs ring-1 ring-primary outline-hidden transition duration-100 ease-linear ring-inset', (isFocused || isOpen) && 'ring-2 ring-brand', isDisabled && 'cursor-not-allowed opacity-50'), children: jsxRuntime.jsx(reactAriaComponents.SelectValue, { className: (state) => cx.cx('flex h-max w-full items-center justify-start truncate text-left align-middle', selectShared.sizes[size].root,
|
|
18
|
+
// With icon
|
|
19
|
+
(state.selectedItems[0]?.icon || icon) && selectShared.sizes[size].withIcon,
|
|
20
|
+
// Icon styles
|
|
21
|
+
'*:data-icon:shrink-0 *:data-icon:text-fg-quaternary'), children: (state) => {
|
|
22
|
+
const selectedItem = state.selectedItems[0];
|
|
23
|
+
const Icon = selectedItem?.icon || icon;
|
|
24
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [selectedItem?.avatarUrl ? (jsxRuntime.jsx(Avatar.Avatar, { size: "xs", src: selectedItem.avatarUrl, alt: selectedItem.label, className: cx.cx(size === 'sm' && 'size-5') })) : isReactComponent.isReactComponent(Icon) ? (jsxRuntime.jsx(Icon, { "data-icon": true, "aria-hidden": "true" })) : React.isValidElement(Icon) ? (Icon) : null, selectedItem ? (jsxRuntime.jsxs("span", { className: cx.cx('flex w-full truncate', selectShared.sizes[size].textContainer), children: [jsxRuntime.jsx("p", { className: cx.cx('truncate font-medium text-primary', selectShared.sizes[size].text), children: selectedItem?.label }), selectedItem?.supportingText && jsxRuntime.jsx("p", { className: cx.cx('text-tertiary', selectShared.sizes[size].text), children: selectedItem?.supportingText })] })) : (jsxRuntime.jsx("p", { className: cx.cx('text-placeholder', selectShared.sizes[size].text), children: placeholder })), jsxRuntime.jsx(uiIcons.ChevronDown, { "aria-hidden": "true", className: cx.cx('ml-auto shrink-0 text-fg-quaternary', size === 'lg' ? 'size-5' : 'size-4 stroke-[2.25px]') })] }));
|
|
25
|
+
} }) }));
|
|
26
|
+
};
|
|
27
|
+
const Select = ({ placeholder = 'Select', icon, size = 'md', children, items, popoverClassName, label, hint, tooltip, hideRequiredIndicator, className, ...rest }) => {
|
|
28
|
+
return (jsxRuntime.jsx(selectShared.SelectContext.Provider, { value: { size }, children: jsxRuntime.jsx(reactAriaComponents.Select, { ...rest, className: (state) => cx.cx('flex flex-col gap-1.5', typeof className === 'function' ? className(state) : className), children: (state) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx(Input.Label, { isRequired: hideRequiredIndicator ? false : state.isRequired, tooltip: tooltip, children: label })), jsxRuntime.jsx(SelectValue, { ...state, size, placeholder, icon: icon }), jsxRuntime.jsx(popover.Popover, { size: size, className: popoverClassName, children: jsxRuntime.jsx(reactAriaComponents.ListBox, { items: items, className: "size-full outline-hidden", children: children }) }), hint && (jsxRuntime.jsx(Input.HintText, { isInvalid: state.isInvalid, className: cx.cx(size === 'sm' && 'text-xs'), children: hint }))] })) }) }));
|
|
29
|
+
};
|
|
30
|
+
const _Select = Select;
|
|
31
|
+
_Select.ComboBox = combobox.ComboBox;
|
|
32
|
+
_Select.Item = selectItem.SelectItem;
|
|
33
|
+
|
|
34
|
+
exports.SelectContext = selectShared.SelectContext;
|
|
35
|
+
exports.sizes = selectShared.sizes;
|
|
36
|
+
exports.Select = _Select;
|
|
37
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/molecules/Select/index.tsx"],"sourcesContent":[null],"names":["_jsx","AriaButton","cx","AriaSelectValue","sizes","_jsxs","Avatar","isReactComponent","isValidElement","ChevronDown","SelectContext","AriaSelect","_Fragment","Label","Popover","AriaListBox","HintText","ComboBox","SelectItem"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAoB,KAAI;IACxG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,QAAA,EAAA,CACG,KAAK,KACJZ,cAAA,CAACa,WAAK,IAAC,UAAU,EAAE,qBAAqB,GAAG,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAA,QAAA,EAClF,KAAK,EAAA,CACA,CACT,EAEDb,cAAA,CAAC,WAAW,EAAA,EAAA,GAAK,KAAK,EAAQ,IAAI,EAAE,WAAW,EAAI,IAAI,EAAE,IAAI,EAAA,CAAI,EAEjEA,cAAA,CAACc,eAAO,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAA,QAAA,EAC9Cd,cAAA,CAACe,2BAAW,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,0BAA0B,EAAA,QAAA,EAC5D,QAAQ,EAAA,CACG,EAAA,CACN,EAET,IAAI,KACHf,cAAA,CAACgB,cAAQ,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAEd,KAAE,CAAC,IAAI,KAAK,IAAI,IAAI,SAAS,CAAC,EAAA,QAAA,EAC5E,IAAI,EAAA,CACI,CACZ,CAAA,EAAA,CACA,CACJ,EAAA,CACU,EAAA,CACU;AAE7B,CAAC;AAED,MAAM,OAAO,GAAG;AAIhB,OAAO,CAAC,QAAQ,GAAGe,iBAAQ;AAC3B,OAAO,CAAC,IAAI,GAAGC,qBAAU;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import type { SelectProps as AriaSelectProps } from 'react-aria-components';
|
|
3
|
+
import { ComboBox } from './components/combobox';
|
|
4
|
+
import { SelectItem } from './components/select-item';
|
|
5
|
+
import { type CommonProps, type SelectItemType } from './components/select-shared';
|
|
6
|
+
export { type CommonProps, SelectContext, type SelectItemType, sizes } from './components/select-shared';
|
|
7
|
+
export interface SelectProps extends Omit<AriaSelectProps<SelectItemType>, 'children' | 'items'>, RefAttributes<HTMLDivElement>, CommonProps {
|
|
8
|
+
items?: SelectItemType[];
|
|
9
|
+
popoverClassName?: string;
|
|
10
|
+
icon?: FC | ReactNode;
|
|
11
|
+
children: ReactNode | ((item: SelectItemType) => ReactNode);
|
|
12
|
+
}
|
|
13
|
+
declare const Select: ({ placeholder, icon, size, children, items, popoverClassName, label, hint, tooltip, hideRequiredIndicator, className, ...rest }: SelectProps) => import("react").JSX.Element;
|
|
14
|
+
declare const _Select: typeof Select & {
|
|
15
|
+
ComboBox: typeof ComboBox;
|
|
16
|
+
Item: typeof SelectItem;
|
|
17
|
+
};
|
|
18
|
+
export { _Select as Select };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Select/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,WAAW,EAAiB,KAAK,cAAc,EAAS,MAAM,4BAA4B,CAAC;AAEzG,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEzG,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,WAAW;IAC1I,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IACtB,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,cAAc,KAAK,SAAS,CAAC,CAAC;CAC7D;AAwED,QAAA,MAAM,MAAM,GAAI,iIAab,WAAW,gCA8Bb,CAAC;AAEF,QAAA,MAAM,OAAO,EAAa,OAAO,MAAM,GAAG;IACxC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC;CACzB,CAAC;AAIF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ChevronDown } from '@flipdish/ui-icons';
|
|
3
|
+
import { Avatar } from '@flipdish/ui-library/components/atoms/Avatar';
|
|
4
|
+
import { Label, HintText } from '@flipdish/ui-library/components/atoms/Input';
|
|
5
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
+
import { isReactComponent } from '@flipdish/ui-library/utilities/isReactComponent';
|
|
7
|
+
import { isValidElement } from 'react';
|
|
8
|
+
import { Select as Select$1, ListBox, Button, SelectValue as SelectValue$1 } from 'react-aria-components';
|
|
9
|
+
import { ComboBox } from './components/combobox.js';
|
|
10
|
+
import { Popover } from './components/popover.js';
|
|
11
|
+
import { SelectItem } from './components/select-item.js';
|
|
12
|
+
import { SelectContext, sizes } from './components/select-shared.js';
|
|
13
|
+
|
|
14
|
+
const SelectValue = ({ isOpen, isFocused, isDisabled, size, placeholder, icon, ref }) => {
|
|
15
|
+
return (jsx(Button, { ref: ref, className: cx('relative flex w-full cursor-pointer items-center rounded-lg bg-primary shadow-xs ring-1 ring-primary outline-hidden transition duration-100 ease-linear ring-inset', (isFocused || isOpen) && 'ring-2 ring-brand', isDisabled && 'cursor-not-allowed opacity-50'), children: jsx(SelectValue$1, { className: (state) => cx('flex h-max w-full items-center justify-start truncate text-left align-middle', sizes[size].root,
|
|
16
|
+
// With icon
|
|
17
|
+
(state.selectedItems[0]?.icon || icon) && sizes[size].withIcon,
|
|
18
|
+
// Icon styles
|
|
19
|
+
'*:data-icon:shrink-0 *:data-icon:text-fg-quaternary'), children: (state) => {
|
|
20
|
+
const selectedItem = state.selectedItems[0];
|
|
21
|
+
const Icon = selectedItem?.icon || icon;
|
|
22
|
+
return (jsxs(Fragment, { children: [selectedItem?.avatarUrl ? (jsx(Avatar, { size: "xs", src: selectedItem.avatarUrl, alt: selectedItem.label, className: cx(size === 'sm' && 'size-5') })) : isReactComponent(Icon) ? (jsx(Icon, { "data-icon": true, "aria-hidden": "true" })) : isValidElement(Icon) ? (Icon) : null, selectedItem ? (jsxs("span", { className: cx('flex w-full truncate', sizes[size].textContainer), children: [jsx("p", { className: cx('truncate font-medium text-primary', sizes[size].text), children: selectedItem?.label }), selectedItem?.supportingText && jsx("p", { className: cx('text-tertiary', sizes[size].text), children: selectedItem?.supportingText })] })) : (jsx("p", { className: cx('text-placeholder', sizes[size].text), children: placeholder })), jsx(ChevronDown, { "aria-hidden": "true", className: cx('ml-auto shrink-0 text-fg-quaternary', size === 'lg' ? 'size-5' : 'size-4 stroke-[2.25px]') })] }));
|
|
23
|
+
} }) }));
|
|
24
|
+
};
|
|
25
|
+
const Select = ({ placeholder = 'Select', icon, size = 'md', children, items, popoverClassName, label, hint, tooltip, hideRequiredIndicator, className, ...rest }) => {
|
|
26
|
+
return (jsx(SelectContext.Provider, { value: { size }, children: jsx(Select$1, { ...rest, className: (state) => cx('flex flex-col gap-1.5', typeof className === 'function' ? className(state) : className), children: (state) => (jsxs(Fragment, { children: [label && (jsx(Label, { isRequired: hideRequiredIndicator ? false : state.isRequired, tooltip: tooltip, children: label })), jsx(SelectValue, { ...state, size, placeholder, icon: icon }), jsx(Popover, { size: size, className: popoverClassName, children: jsx(ListBox, { items: items, className: "size-full outline-hidden", children: children }) }), hint && (jsx(HintText, { isInvalid: state.isInvalid, className: cx(size === 'sm' && 'text-xs'), children: hint }))] })) }) }));
|
|
27
|
+
};
|
|
28
|
+
const _Select = Select;
|
|
29
|
+
_Select.ComboBox = ComboBox;
|
|
30
|
+
_Select.Item = SelectItem;
|
|
31
|
+
|
|
32
|
+
export { _Select as Select, SelectContext, sizes };
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Select/index.tsx"],"sourcesContent":[null],"names":["_jsx","AriaButton","AriaSelectValue","_jsxs","AriaSelect","_Fragment","AriaListBox"],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAoB,KAAI;IACxG,QACEA,IAACC,MAAU,EAAA,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,oKAAoK,EACpK,CAAC,SAAS,IAAI,MAAM,KAAK,mBAAmB,EAC5C,UAAU,IAAI,+BAA+B,CAC9C,YAEDD,GAAA,CAACE,aAAe,IACd,SAAS,EAAE,CAAC,KAAK,KACf,EAAE,CACA,8EAA8E,EAE9E,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI;;AAGhB,YAAA,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ;;AAG9D,YAAA,qDAAqD,CACtD,EAAA,QAAA,EAGF,CAAC,KAAK,KAAI;gBACT,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;AAC3C,gBAAA,MAAM,IAAI,GAAG,YAAY,EAAE,IAAI,IAAI,IAAI;gBAEvC,QACEC,4BACG,YAAY,EAAE,SAAS,IACtBH,GAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,IAAI,EAAC,GAAG,EAAE,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE,YAA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,GAAG,QAAQ;AAC3B,OAAO,CAAC,IAAI,GAAG,UAAU;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
+
var Button = require('@flipdish/ui-library/components/atoms/Button');
|
|
6
|
+
var Input = require('@flipdish/ui-library/components/atoms/Input');
|
|
7
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
8
|
+
|
|
9
|
+
const PageHeaderSimple = ({ title, description, breadcrumbs, backLabel, backHref = '#', actions, showSearch = false, withDivider = false, className, }) => {
|
|
10
|
+
return (jsxRuntime.jsxs("div", { className: cx.cx('relative flex flex-col gap-4 bg-primary', className), children: [breadcrumbs && jsxRuntime.jsx("div", { className: "max-lg:hidden", children: breadcrumbs }), backLabel && (jsxRuntime.jsx("div", { className: "flex lg:hidden", children: jsxRuntime.jsx(Button.Button, { href: backHref, color: "link-gray", size: "xs", iconLeading: uiIcons.ArrowLeft, children: backLabel }) })), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col gap-4 lg:flex-row', withDivider && 'border-b border-secondary pb-4'), children: [jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-0.5", children: [title && jsxRuntime.jsx("h1", { className: "text-xl font-semibold text-primary", children: title }), description && jsxRuntime.jsx("p", { className: "text-md text-tertiary", children: description })] }), actions && jsxRuntime.jsx("div", { className: "flex items-start gap-3", children: actions }), showSearch && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Input.Input, { className: "w-full md:hidden", size: "md", "aria-label": "Search", placeholder: "Search", icon: uiIcons.SearchLg }), jsxRuntime.jsx(Input.Input, { shortcut: true, className: "w-full max-w-70 max-md:hidden", size: "sm", "aria-label": "Search", placeholder: "Search", icon: uiIcons.SearchLg })] }))] })] }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.PageHeaderSimple = PageHeaderSimple;
|
|
14
|
+
//# sourceMappingURL=page-header-simple.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header-simple.cjs","sources":["../../../../../src/components/organisms/PageHeader/components/page-header-simple.tsx"],"sourcesContent":[null],"names":["_jsxs","cx","_jsx","Button","ArrowLeft","Input","SearchLg"],"mappings":";;;;;;;;AA4BO,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,SAAS,GACa,KAAI;AAC1B,IAAA,QACEA,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,KAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACrE,WAAW,IAAIC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,eAAe,EAAA,QAAA,EAAE,WAAW,GAAO,EAEjE,SAAS,KACRA,wBAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAC7BA,eAACC,aAAM,EAAA,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,IAAI,EAAC,WAAW,EAAEC,iBAAS,EAAA,QAAA,EACvE,SAAS,GACH,EAAA,CACL,CACP,EAEDJ,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,KAAE,CAAC,iCAAiC,EAAE,WAAW,IAAI,gCAAgC,CAAC,aACpGD,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,8BAA8B,aAC1C,KAAK,IAAIE,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAE,KAAK,EAAA,CAAM,EACxE,WAAW,IAAIA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAE,WAAW,EAAA,CAAK,IAClE,EAEL,OAAO,IAAIA,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,wBAAwB,EAAA,QAAA,EAAE,OAAO,GAAO,EAElE,UAAU,KACTF,kDAEEE,cAAA,CAACG,WAAK,EAAA,EAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,IAAI,EAAA,YAAA,EAAY,QAAQ,EAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAEC,gBAAQ,EAAA,CAAI,EAGzGJ,cAAA,CAACG,WAAK,IAAC,QAAQ,EAAA,IAAA,EAAC,SAAS,EAAC,+BAA+B,EAAC,IAAI,EAAC,IAAI,gBAAY,QAAQ,EAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAEC,gBAAQ,GAAI,CAAA,EAAA,CAC9H,CACJ,CAAA,EAAA,CACG,CAAA,EAAA,CACF;AAEV;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PageHeaderSimpleProps {
|
|
3
|
+
/** Page title (rendered as the `h1`). */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Supporting text shown beneath the title. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Breadcrumb trail shown on desktop — pass a complete `<Breadcrumbs>` element so the
|
|
9
|
+
* caller owns the items, divider and `type`. Hidden below the `lg` breakpoint.
|
|
10
|
+
*/
|
|
11
|
+
breadcrumbs?: ReactNode;
|
|
12
|
+
/** Mobile "back" link label. When set, a back link replaces the breadcrumbs below `lg`. */
|
|
13
|
+
backLabel?: string;
|
|
14
|
+
backHref?: string;
|
|
15
|
+
/** Action buttons rendered to the right of the title on desktop. */
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
/** Render the search inputs (mobile + desktop). */
|
|
18
|
+
showSearch?: boolean;
|
|
19
|
+
/** Render the divider beneath the title row. */
|
|
20
|
+
withDivider?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const PageHeaderSimple: ({ title, description, breadcrumbs, backLabel, backHref, actions, showSearch, withDivider, className, }: PageHeaderSimpleProps) => import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=page-header-simple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header-simple.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/PageHeader/components/page-header-simple.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,wGAU9B,qBAAqB,gCAiCvB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ArrowLeft, SearchLg } from '@flipdish/ui-icons';
|
|
3
|
+
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
4
|
+
import { Input } from '@flipdish/ui-library/components/atoms/Input';
|
|
5
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
+
|
|
7
|
+
const PageHeaderSimple = ({ title, description, breadcrumbs, backLabel, backHref = '#', actions, showSearch = false, withDivider = false, className, }) => {
|
|
8
|
+
return (jsxs("div", { className: cx('relative flex flex-col gap-4 bg-primary', className), children: [breadcrumbs && jsx("div", { className: "max-lg:hidden", children: breadcrumbs }), backLabel && (jsx("div", { className: "flex lg:hidden", children: jsx(Button, { href: backHref, color: "link-gray", size: "xs", iconLeading: ArrowLeft, children: backLabel }) })), jsxs("div", { className: cx('flex flex-col gap-4 lg:flex-row', withDivider && 'border-b border-secondary pb-4'), children: [jsxs("div", { className: "flex flex-1 flex-col gap-0.5", children: [title && jsx("h1", { className: "text-xl font-semibold text-primary", children: title }), description && jsx("p", { className: "text-md text-tertiary", children: description })] }), actions && jsx("div", { className: "flex items-start gap-3", children: actions }), showSearch && (jsxs(Fragment, { children: [jsx(Input, { className: "w-full md:hidden", size: "md", "aria-label": "Search", placeholder: "Search", icon: SearchLg }), jsx(Input, { shortcut: true, className: "w-full max-w-70 max-md:hidden", size: "sm", "aria-label": "Search", placeholder: "Search", icon: SearchLg })] }))] })] }));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { PageHeaderSimple };
|
|
12
|
+
//# sourceMappingURL=page-header-simple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header-simple.js","sources":["../../../../../src/components/organisms/PageHeader/components/page-header-simple.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;AA4BO,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,SAAS,GACa,KAAI;AAC1B,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACrE,WAAW,IAAIC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,eAAe,EAAA,QAAA,EAAE,WAA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":";;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page-level header bar containing a title, optional breadcrumb, and action slots.
|
|
3
|
+
*
|
|
4
|
+
* @summary page header with title and optional actions
|
|
5
|
+
*/
|
|
6
|
+
export { PageHeaderSimple as Simple } from './components/page-header-simple';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/PageHeader/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generic 404 page template used by consuming apps as the fallback route.
|
|
7
|
+
*
|
|
8
|
+
* Lives under `components/templates/` per the atomic-design folder structure: it composes plain HTML
|
|
9
|
+
* elements + Tailwind utilities into a complete page-shaped layout. Consumers (e.g. `App.routes.tsx`)
|
|
10
|
+
* wrap this in a `<Route path="*">` and provide localised copy via props.
|
|
11
|
+
*
|
|
12
|
+
* Doubles as the Tailwind v4 + Option A CSS-isolation smoke test for the property-service MFE —
|
|
13
|
+
* if these utility classes render correctly inside `#flipdish-micro-frontend` without polluting
|
|
14
|
+
* Portal chrome, the scoping pipeline works end-to-end.
|
|
15
|
+
*/
|
|
16
|
+
const NotFoundPage = ({ title = '404', description = 'The page you were looking for could not be found.', }) => (jsxRuntime.jsxs("main", { className: "flex min-h-[50vh] flex-col items-center justify-center gap-3 p-8 text-center", children: [jsxRuntime.jsx("h1", { className: "text-4xl font-semibold text-gray-900", children: title }), jsxRuntime.jsx("p", { className: "text-base text-gray-600", children: description })] }));
|
|
17
|
+
|
|
18
|
+
exports.NotFoundPage = NotFoundPage;
|
|
19
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/NotFoundPage/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;AAcA;;;;;;;;;;AAUG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,GAAG,KAAK,EACb,WAAW,GAAG,mDAAmD,GAC/C,MAClBA,eAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,8EAA8E,aAC5FC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,sCAAsC,EAAA,QAAA,EAAE,KAAK,EAAA,CAAM,EACjEA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,yBAAyB,EAAA,QAAA,EAAE,WAAW,EAAA,CAAK,CAAA,EAAA,CACnD;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the NotFoundPage component.
|
|
4
|
+
* @param title - The title of the page. Defaults to "404".
|
|
5
|
+
* @param description - The description of the page. Defaults to "The page you were looking for could not be found."
|
|
6
|
+
*/
|
|
7
|
+
export interface NotFoundPageProps {
|
|
8
|
+
/** Heading shown above the description. Defaults to "404". */
|
|
9
|
+
readonly title?: string;
|
|
10
|
+
/** Body copy explaining the error. Defaults to "The page you were looking for could not be found." */
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Generic 404 page template used by consuming apps as the fallback route.
|
|
15
|
+
*
|
|
16
|
+
* Lives under `components/templates/` per the atomic-design folder structure: it composes plain HTML
|
|
17
|
+
* elements + Tailwind utilities into a complete page-shaped layout. Consumers (e.g. `App.routes.tsx`)
|
|
18
|
+
* wrap this in a `<Route path="*">` and provide localised copy via props.
|
|
19
|
+
*
|
|
20
|
+
* Doubles as the Tailwind v4 + Option A CSS-isolation smoke test for the property-service MFE —
|
|
21
|
+
* if these utility classes render correctly inside `#flipdish-micro-frontend` without polluting
|
|
22
|
+
* Portal chrome, the scoping pipeline works end-to-end.
|
|
23
|
+
*/
|
|
24
|
+
export declare const NotFoundPage: ({ title, description, }: NotFoundPageProps) => ReactElement;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/NotFoundPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sGAAsG;IACtG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,yBAG1B,iBAAiB,KAAG,YAKtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic 404 page template used by consuming apps as the fallback route.
|
|
5
|
+
*
|
|
6
|
+
* Lives under `components/templates/` per the atomic-design folder structure: it composes plain HTML
|
|
7
|
+
* elements + Tailwind utilities into a complete page-shaped layout. Consumers (e.g. `App.routes.tsx`)
|
|
8
|
+
* wrap this in a `<Route path="*">` and provide localised copy via props.
|
|
9
|
+
*
|
|
10
|
+
* Doubles as the Tailwind v4 + Option A CSS-isolation smoke test for the property-service MFE —
|
|
11
|
+
* if these utility classes render correctly inside `#flipdish-micro-frontend` without polluting
|
|
12
|
+
* Portal chrome, the scoping pipeline works end-to-end.
|
|
13
|
+
*/
|
|
14
|
+
const NotFoundPage = ({ title = '404', description = 'The page you were looking for could not be found.', }) => (jsxs("main", { className: "flex min-h-[50vh] flex-col items-center justify-center gap-3 p-8 text-center", children: [jsx("h1", { className: "text-4xl font-semibold text-gray-900", children: title }), jsx("p", { className: "text-base text-gray-600", children: description })] }));
|
|
15
|
+
|
|
16
|
+
export { NotFoundPage };
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/templates/NotFoundPage/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;AAcA;;;;;;;;;;AAUG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,GAAG,KAAK,EACb,WAAW,GAAG,mDAAmD,GAC/C,MAClBA,IAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,8EAA8E,aAC5FC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,sCAAsC,EAAA,QAAA,EAAE,KAAK,EAAA,CAAM,EACjEA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,yBAAyB,EAAA,QAAA,EAAE,WAAW,EAAA,CAAK,CAAA,EAAA,CACnD;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var ErrorBoundary = require('@flipdish/ui-library/providers/ErrorBoundary');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* English defaults, overridable via `renderError` (the consumer owns localisation).
|
|
9
|
+
* TODO(i18n): once ui-library has its own translation layer, source these strings
|
|
10
|
+
* from it instead of hardcoding English (keep `renderError` as a consumer override).
|
|
11
|
+
*/
|
|
12
|
+
const DefaultPageError = () => (jsxRuntime.jsxs("div", { role: "alert", className: "flex w-full max-w-container flex-col items-center gap-2 px-md py-2xl text-center lg:px-2xl", children: [jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-primary", children: "Something went wrong" }), jsxRuntime.jsx("p", { className: "text-md text-tertiary", children: "An unexpected error occurred while loading this page." })] }));
|
|
13
|
+
/**
|
|
14
|
+
* Page-shaped template that standardises the MFE's page chrome: the centered `<main>`
|
|
15
|
+
* scroll container, an optional header region, and a page-scoped error boundary keyed
|
|
16
|
+
* by `pageName`. Consumers drop their page content in as children.
|
|
17
|
+
*
|
|
18
|
+
* The boundary wraps `children` only, not the header: content (data-fetching, forms,
|
|
19
|
+
* dynamic logic) is where throws realistically happen, and keeping the header outside
|
|
20
|
+
* means breadcrumbs/back link stay usable so the user can navigate away when content
|
|
21
|
+
* fails — strictly better than blanking the whole page. A header throw (rare, since
|
|
22
|
+
* it's static chrome) isn't caught here, but the app-level ErrorBoundary higher up the
|
|
23
|
+
* tree still catches it; nothing goes unhandled.
|
|
24
|
+
*/
|
|
25
|
+
const PageLayout = ({ pageName, header, children, renderError, onError, className }) => {
|
|
26
|
+
return (jsxRuntime.jsxs("main", { className: cx.cx('flex w-full flex-col items-center gap-xl py-2xl lg:gap-2xl lg:pb-3xl', className), children: [header, jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => renderError?.({ error, pageName }) ?? jsxRuntime.jsx(DefaultPageError, {}), children: children })] }));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.PageLayout = PageLayout;
|
|
30
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","cx","ErrorBoundary"],"mappings":";;;;;;AAgCA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,OACvBA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,4FAA4F,EAAA,QAAA,EAAA,CACtHC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;;;;AAWG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAmB,KAAe;IACxH,QACED,0BAAM,SAAS,EAAEE,KAAE,CAAC,sEAAsE,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACnG,MAAM,EAEPD,cAAA,CAACE,2BAAa,EAAA,EAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,IAAIF,cAAA,CAAC,gBAAgB,EAAA,EAAA,CAAG,YACzI,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutProps {
|
|
3
|
+
/**
|
|
4
|
+
* Stable, human-readable name of the page (e.g. "CollectionSettings"). Tags the
|
|
5
|
+
* page-level error boundary so a thrown error can be attributed to a specific page
|
|
6
|
+
* in logs/RUM, and is forwarded to `renderError` and `onError`.
|
|
7
|
+
*/
|
|
8
|
+
pageName: string;
|
|
9
|
+
/**
|
|
10
|
+
* Header region. Compose `<PageHeader.Simple>` (or a feature wrapper around it)
|
|
11
|
+
* here. Rendered OUTSIDE the error boundary so page chrome (breadcrumbs, back link)
|
|
12
|
+
* stays usable when the content below throws.
|
|
13
|
+
*/
|
|
14
|
+
header?: ReactNode;
|
|
15
|
+
/** Page content, rendered INSIDE the error boundary. */
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Replaces the default fallback shown when a child throws. Receives the thrown
|
|
19
|
+
* error and `pageName` so consumers can render localised copy.
|
|
20
|
+
*/
|
|
21
|
+
renderError?: (props: {
|
|
22
|
+
error: Error;
|
|
23
|
+
pageName: string;
|
|
24
|
+
}) => ReactNode;
|
|
25
|
+
/** Called when a child throws — wire app-level reporting (e.g. Datadog RUM) here. */
|
|
26
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
27
|
+
/** Extra classes merged onto the root `<main>`. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Page-shaped template that standardises the MFE's page chrome: the centered `<main>`
|
|
32
|
+
* scroll container, an optional header region, and a page-scoped error boundary keyed
|
|
33
|
+
* by `pageName`. Consumers drop their page content in as children.
|
|
34
|
+
*
|
|
35
|
+
* The boundary wraps `children` only, not the header: content (data-fetching, forms,
|
|
36
|
+
* dynamic logic) is where throws realistically happen, and keeping the header outside
|
|
37
|
+
* means breadcrumbs/back link stay usable so the user can navigate away when content
|
|
38
|
+
* fails — strictly better than blanking the whole page. A header throw (rare, since
|
|
39
|
+
* it's static chrome) isn't caught here, but the app-level ErrorBoundary higher up the
|
|
40
|
+
* tree still catches it; nothing goes unhandled.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PageLayout: ({ pageName, header, children, renderError, onError, className }: PageLayoutProps) => ReactNode;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACvE,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAI,iEAAiE,eAAe,KAAG,SAU7G,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ErrorBoundary } from '@flipdish/ui-library/providers/ErrorBoundary';
|
|
3
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* English defaults, overridable via `renderError` (the consumer owns localisation).
|
|
7
|
+
* TODO(i18n): once ui-library has its own translation layer, source these strings
|
|
8
|
+
* from it instead of hardcoding English (keep `renderError` as a consumer override).
|
|
9
|
+
*/
|
|
10
|
+
const DefaultPageError = () => (jsxs("div", { role: "alert", className: "flex w-full max-w-container flex-col items-center gap-2 px-md py-2xl text-center lg:px-2xl", children: [jsx("h2", { className: "text-lg font-semibold text-primary", children: "Something went wrong" }), jsx("p", { className: "text-md text-tertiary", children: "An unexpected error occurred while loading this page." })] }));
|
|
11
|
+
/**
|
|
12
|
+
* Page-shaped template that standardises the MFE's page chrome: the centered `<main>`
|
|
13
|
+
* scroll container, an optional header region, and a page-scoped error boundary keyed
|
|
14
|
+
* by `pageName`. Consumers drop their page content in as children.
|
|
15
|
+
*
|
|
16
|
+
* The boundary wraps `children` only, not the header: content (data-fetching, forms,
|
|
17
|
+
* dynamic logic) is where throws realistically happen, and keeping the header outside
|
|
18
|
+
* means breadcrumbs/back link stay usable so the user can navigate away when content
|
|
19
|
+
* fails — strictly better than blanking the whole page. A header throw (rare, since
|
|
20
|
+
* it's static chrome) isn't caught here, but the app-level ErrorBoundary higher up the
|
|
21
|
+
* tree still catches it; nothing goes unhandled.
|
|
22
|
+
*/
|
|
23
|
+
const PageLayout = ({ pageName, header, children, renderError, onError, className }) => {
|
|
24
|
+
return (jsxs("main", { className: cx('flex w-full flex-col items-center gap-xl py-2xl lg:gap-2xl lg:pb-3xl', className), children: [header, jsx(ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => renderError?.({ error, pageName }) ?? jsx(DefaultPageError, {}), children: children })] }));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { PageLayout };
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;AAgCA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,OACvBA,IAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,4FAA4F,EAAA,QAAA,EAAA,CACtHC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;;;;AAWG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAmB,KAAe;IACxH,QACED,eAAM,SAAS,EAAE,EAAE,CAAC,sEAAsE,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACnG,MAAM,EAEPC,GAAA,CAAC,aAAa,EAAA,EAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,IAAIA,GAAA,CAAC,gBAAgB,EAAA,EAAA,CAAG,YACzI,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the ResizeObserver API is supported.
|
|
7
|
+
* @returns True if the ResizeObserver API is supported, false otherwise.
|
|
8
|
+
*/
|
|
9
|
+
function hasResizeObserver() {
|
|
10
|
+
return typeof window.ResizeObserver !== 'undefined';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A hook that observes the size of an element and calls a callback function when the size changes.
|
|
14
|
+
* @param options - The options for the hook.
|
|
15
|
+
*/
|
|
16
|
+
function useResizeObserver(options) {
|
|
17
|
+
const { ref, box, onResize } = options;
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
const element = ref?.current;
|
|
20
|
+
if (!element) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!hasResizeObserver()) {
|
|
24
|
+
window.addEventListener('resize', onResize, false);
|
|
25
|
+
return () => {
|
|
26
|
+
window.removeEventListener('resize', onResize, false);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const resizeObserverInstance = new window.ResizeObserver((entries) => {
|
|
31
|
+
if (!entries.length) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
onResize();
|
|
35
|
+
});
|
|
36
|
+
resizeObserverInstance.observe(element, { box });
|
|
37
|
+
return () => {
|
|
38
|
+
if (element) {
|
|
39
|
+
resizeObserverInstance.unobserve(element);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}, [onResize, ref, box]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.useResizeObserver = useResizeObserver;
|
|
47
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/useResizeObserver/index.ts"],"sourcesContent":[null],"names":["useEffect"],"mappings":";;;;AAEA;;;AAGG;AACH,SAAS,iBAAiB,GAAA;AACxB,IAAA,OAAO,OAAO,MAAM,CAAC,cAAc,KAAK,WAAW;AACrD;AAoBA;;;AAGG;AACG,SAAU,iBAAiB,CAAoB,OAAwC,EAAA;IAC3F,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAAO;IAEtCA,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO;QAC5B,IAAI,CAAC,OAAO,EAAE;YACZ;QACF;AAEA,QAAA,IAAI,CAAC,iBAAiB,EAAE,EAAE;YACxB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC;AAElD,YAAA,OAAO,MAAK;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC;AACvD,YAAA,CAAC;QACH;aAAO;YACL,MAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,KAAI;AACnE,gBAAA,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;oBACnB;gBACF;AAEA,gBAAA,QAAQ,EAAE;AACZ,YAAA,CAAC,CAAC;YAEF,sBAAsB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC;AAEhD,YAAA,OAAO,MAAK;gBACV,IAAI,OAAO,EAAE;AACX,oBAAA,sBAAsB,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC3C;AACF,YAAA,CAAC;QACH;IACF,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1B;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The options for the useResizeObserver hook.
|
|
4
|
+
*/
|
|
5
|
+
type useResizeObserverOptionsType<T> = {
|
|
6
|
+
/**
|
|
7
|
+
* The ref to the element to observe.
|
|
8
|
+
*/
|
|
9
|
+
ref: RefObject<T | undefined | null> | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The box to observe.
|
|
12
|
+
*/
|
|
13
|
+
box?: ResizeObserverBoxOptions;
|
|
14
|
+
/**
|
|
15
|
+
* The callback function to call when the size changes.
|
|
16
|
+
*/
|
|
17
|
+
onResize: () => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A hook that observes the size of an element and calls a callback function when the size changes.
|
|
21
|
+
* @param options - The options for the hook.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResizeObserver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAUlD;;GAEG;AACH,KAAK,4BAA4B,CAAC,CAAC,IAAI;IACrC;;OAEG;IACH,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,GAAG,CAAC,EAAE,wBAAwB,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC,QAiC5F"}
|