frontile 0.18.6 → 0.18.8
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/declarations/-private/icons.d.ts +4 -0
- package/declarations/-private/icons.d.ts.map +1 -1
- package/declarations/components/buttons/chip.d.ts +2 -3
- package/declarations/components/buttons/chip.d.ts.map +1 -1
- package/declarations/components/collections/dropdown/dropdown.d.ts +50 -53
- package/declarations/components/collections/dropdown/dropdown.d.ts.map +1 -1
- package/declarations/components/collections/listbox/item.d.ts +52 -1
- package/declarations/components/collections/listbox/item.d.ts.map +1 -1
- package/declarations/components/forms/form.d.ts +3 -2
- package/declarations/components/forms/form.d.ts.map +1 -1
- package/declarations/components/forms/native-select.d.ts.map +1 -1
- package/declarations/components/forms/select/select.d.ts +17 -0
- package/declarations/components/forms/select/select.d.ts.map +1 -1
- package/declarations/components/forms/select/trigger.d.ts +8 -0
- package/declarations/components/forms/select/trigger.d.ts.map +1 -1
- package/declarations/components/forms/select/types.d.ts +8 -4
- package/declarations/components/forms/select/types.d.ts.map +1 -1
- package/declarations/components/layout/app-layout-state.d.ts +32 -0
- package/declarations/components/layout/app-layout-state.d.ts.map +1 -0
- package/declarations/components/layout/app-layout.d.ts +1298 -0
- package/declarations/components/layout/app-layout.d.ts.map +1 -0
- package/declarations/components/layout/aside-toggle.d.ts +55 -0
- package/declarations/components/layout/aside-toggle.d.ts.map +1 -0
- package/declarations/components/layout/aside.d.ts +1055 -0
- package/declarations/components/layout/aside.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav-more.d.ts +123 -0
- package/declarations/components/layout/bottom-nav-more.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav.d.ts +60 -0
- package/declarations/components/layout/bottom-nav.d.ts.map +1 -0
- package/declarations/components/layout/context.d.ts +143 -0
- package/declarations/components/layout/context.d.ts.map +1 -0
- package/declarations/components/layout/index.d.ts +14 -0
- package/declarations/components/layout/index.d.ts.map +1 -0
- package/declarations/components/layout/main.d.ts +28 -0
- package/declarations/components/layout/main.d.ts.map +1 -0
- package/declarations/components/layout/menu-toggle.d.ts +58 -0
- package/declarations/components/layout/menu-toggle.d.ts.map +1 -0
- package/declarations/components/layout/nav-context.d.ts +45 -0
- package/declarations/components/layout/nav-context.d.ts.map +1 -0
- package/declarations/components/layout/nav-folder.d.ts +216 -0
- package/declarations/components/layout/nav-folder.d.ts.map +1 -0
- package/declarations/components/layout/nav-item.d.ts +220 -0
- package/declarations/components/layout/nav-item.d.ts.map +1 -0
- package/declarations/components/layout/nav-link.d.ts +67 -0
- package/declarations/components/layout/nav-link.d.ts.map +1 -0
- package/declarations/components/layout/navbar.d.ts +1028 -0
- package/declarations/components/layout/navbar.d.ts.map +1 -0
- package/declarations/components/layout/page-header.d.ts +40 -0
- package/declarations/components/layout/page-header.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-group.d.ts +41 -0
- package/declarations/components/layout/sidebar-group.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-toggle.d.ts +71 -0
- package/declarations/components/layout/sidebar-toggle.d.ts.map +1 -0
- package/declarations/components/layout/sidebar.d.ts +1215 -0
- package/declarations/components/layout/sidebar.d.ts.map +1 -0
- package/declarations/components/navigation/index.d.ts +1 -0
- package/declarations/components/navigation/index.d.ts.map +1 -1
- package/declarations/components/navigation/stepper/collapse-menu.d.ts +42 -0
- package/declarations/components/navigation/stepper/collapse-menu.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/list.d.ts +24 -0
- package/declarations/components/navigation/stepper/list.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/panel.d.ts +42 -0
- package/declarations/components/navigation/stepper/panel.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/step.d.ts +123 -0
- package/declarations/components/navigation/stepper/step.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/stepper.d.ts +947 -0
- package/declarations/components/navigation/stepper/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/stepper.d.ts +6 -0
- package/declarations/components/navigation/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +2 -2
- package/declarations/components/navigation/tab-nav/item.d.ts.map +1 -1
- package/declarations/components/overlays/portal.d.ts.map +1 -1
- package/declarations/components/status/badge.d.ts +83 -0
- package/declarations/components/status/badge.d.ts.map +1 -0
- package/declarations/components/status/index.d.ts +1 -0
- package/declarations/components/status/index.d.ts.map +1 -1
- package/declarations/components/utilities/collapsible.d.ts +19 -2
- package/declarations/components/utilities/collapsible.d.ts.map +1 -1
- package/declarations/index.d.ts +1 -0
- package/declarations/index.d.ts.map +1 -1
- package/declarations/layout.d.ts +2 -0
- package/declarations/layout.d.ts.map +1 -0
- package/declarations/utils/breakpoint.d.ts +16 -0
- package/declarations/utils/breakpoint.d.ts.map +1 -0
- package/declarations/utils/document-listener.d.ts +6 -0
- package/declarations/utils/document-listener.d.ts.map +1 -0
- package/declarations/utils/listManager.d.ts +7 -1
- package/declarations/utils/listManager.d.ts.map +1 -1
- package/declarations/utils/route-active.d.ts +34 -0
- package/declarations/utils/route-active.d.ts.map +1 -0
- package/declarations/utils/selection-indicator.d.ts +7 -4
- package/declarations/utils/selection-indicator.d.ts.map +1 -1
- package/dist/components/buttons/chip.js +12 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/collections/calendar/header.js +1 -1
- package/dist/components/collections/dropdown/dropdown.js +172 -48
- package/dist/components/collections/dropdown/dropdown.js.map +1 -1
- package/dist/components/collections/listbox/item.js +36 -2
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/forms/autocomplete.js +1 -1
- package/dist/components/forms/date-picker/end-content.js +1 -1
- package/dist/components/forms/form.js.map +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/native-select.js.map +1 -1
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/select.js +3 -2
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/forms/select/trigger.js +1 -1
- package/dist/components/forms/select/trigger.js.map +1 -1
- package/dist/components/layout/app-layout-state.js +64 -0
- package/dist/components/layout/app-layout-state.js.map +1 -0
- package/dist/components/layout/app-layout.js +441 -0
- package/dist/components/layout/app-layout.js.map +1 -0
- package/dist/components/layout/aside-toggle.js +55 -0
- package/dist/components/layout/aside-toggle.js.map +1 -0
- package/dist/components/layout/aside.js +98 -0
- package/dist/components/layout/aside.js.map +1 -0
- package/dist/components/layout/bottom-nav-more.js +150 -0
- package/dist/components/layout/bottom-nav-more.js.map +1 -0
- package/dist/components/layout/bottom-nav.js +65 -0
- package/dist/components/layout/bottom-nav.js.map +1 -0
- package/dist/components/layout/context.js +103 -0
- package/dist/components/layout/context.js.map +1 -0
- package/dist/components/layout/index.js +14 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/main.js +34 -0
- package/dist/components/layout/main.js.map +1 -0
- package/dist/components/layout/menu-toggle.js +61 -0
- package/dist/components/layout/menu-toggle.js.map +1 -0
- package/dist/components/layout/nav-context.js +85 -0
- package/dist/components/layout/nav-context.js.map +1 -0
- package/dist/components/layout/nav-folder.js +271 -0
- package/dist/components/layout/nav-folder.js.map +1 -0
- package/dist/components/layout/nav-item.js +192 -0
- package/dist/components/layout/nav-item.js.map +1 -0
- package/dist/components/layout/nav-link.js +58 -0
- package/dist/components/layout/nav-link.js.map +1 -0
- package/dist/components/layout/navbar.js +51 -0
- package/dist/components/layout/navbar.js.map +1 -0
- package/dist/components/layout/page-header.js +45 -0
- package/dist/components/layout/page-header.js.map +1 -0
- package/dist/components/layout/sidebar-group.js +41 -0
- package/dist/components/layout/sidebar-group.js.map +1 -0
- package/dist/components/layout/sidebar-toggle.js +82 -0
- package/dist/components/layout/sidebar-toggle.js.map +1 -0
- package/dist/components/layout/sidebar.js +252 -0
- package/dist/components/layout/sidebar.js.map +1 -0
- package/dist/components/navigation/breadcrumbs/separator.js +1 -1
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/stepper/collapse-menu.js +128 -0
- package/dist/components/navigation/stepper/collapse-menu.js.map +1 -0
- package/dist/components/navigation/stepper/list.js +17 -0
- package/dist/components/navigation/stepper/list.js.map +1 -0
- package/dist/components/navigation/stepper/panel.js +26 -0
- package/dist/components/navigation/stepper/panel.js.map +1 -0
- package/dist/components/navigation/stepper/step.js +130 -0
- package/dist/components/navigation/stepper/step.js.map +1 -0
- package/dist/components/navigation/stepper/stepper.js +475 -0
- package/dist/components/navigation/stepper/stepper.js.map +1 -0
- package/dist/components/navigation/stepper.js +5 -0
- package/dist/components/navigation/stepper.js.map +1 -0
- package/dist/components/navigation/tab-nav/item.js +6 -40
- package/dist/components/navigation/tab-nav/item.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +2 -2
- package/dist/components/notifications/notifications-container.js +1 -1
- package/dist/components/overlays/portal.js +11 -2
- package/dist/components/overlays/portal.js.map +1 -1
- package/dist/components/status/alert.js +1 -1
- package/dist/components/status/badge.js +52 -0
- package/dist/components/status/badge.js.map +1 -0
- package/dist/components/status/index.js +1 -0
- package/dist/components/status/index.js.map +1 -1
- package/dist/components/utilities/collapsible.js +33 -5
- package/dist/components/utilities/collapsible.js.map +1 -1
- package/dist/{icons-DZ61nCzv.js → icons-55dthVFk.js} +14 -2
- package/dist/{icons-DZ61nCzv.js.map → icons-55dthVFk.js.map} +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.js +14 -0
- package/dist/layout.js.map +1 -0
- package/dist/navigation.js +4 -0
- package/dist/navigation.js.map +1 -1
- package/dist/{notification-card-dz-eE6z9.js → notification-card-BPfDo-Gf.js} +2 -2
- package/dist/{notification-card-dz-eE6z9.js.map → notification-card-BPfDo-Gf.js.map} +1 -1
- package/dist/notifications.js +1 -1
- package/dist/status.js +1 -0
- package/dist/status.js.map +1 -1
- package/dist/utils/breakpoint.js +56 -0
- package/dist/utils/breakpoint.js.map +1 -0
- package/dist/utils/document-listener.js +10 -0
- package/dist/utils/document-listener.js.map +1 -0
- package/dist/utils/listManager.js +12 -2
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/route-active.js +70 -0
- package/dist/utils/route-active.js.map +1 -0
- package/dist/utils/selection-indicator.js +25 -5
- package/dist/utils/selection-indicator.js.map +1 -1
- package/package.json +7 -3
|
@@ -46,6 +46,18 @@ const IconWarning = setComponentTemplate(precompileTemplate("<svg xmlns=\"http:/
|
|
|
46
46
|
const IconDanger = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"danger\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>", {
|
|
47
47
|
strictMode: true
|
|
48
48
|
}), templateOnly());
|
|
49
|
+
const EllipsisHorizontalIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z\" />\n</svg>", {
|
|
50
|
+
strictMode: true
|
|
51
|
+
}), templateOnly());
|
|
52
|
+
const SidebarLeftIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M9 4v16\" />\n</svg>", {
|
|
53
|
+
strictMode: true
|
|
54
|
+
}), templateOnly());
|
|
55
|
+
const SidebarRightIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M15 4v16\" />\n</svg>", {
|
|
56
|
+
strictMode: true
|
|
57
|
+
}), templateOnly());
|
|
58
|
+
const MenuIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <path d=\"M4 6h16M4 12h16M4 18h16\" />\n</svg>", {
|
|
59
|
+
strictMode: true
|
|
60
|
+
}), templateOnly());
|
|
49
61
|
|
|
50
|
-
export { ColumnVisibilityIcon as C, IconChevronUpDown as I, ChevronDownIcon as a, ChevronUpIcon as b, ChevronRightIcon as c, ChevronLeftIcon as d, IconCalendar as e,
|
|
51
|
-
//# sourceMappingURL=icons-
|
|
62
|
+
export { ColumnVisibilityIcon as C, EllipsisHorizontalIcon as E, IconChevronUpDown as I, MenuIcon as M, SidebarRightIcon as S, ChevronDownIcon as a, ChevronUpIcon as b, ChevronRightIcon as c, ChevronLeftIcon as d, IconCalendar as e, SidebarLeftIcon as f, ChevronDoubleRightIcon as g, ChevronDoubleLeftIcon as h, IconDanger as i, IconWarning as j, IconSuccess as k, IconInfo as l };
|
|
63
|
+
//# sourceMappingURL=icons-55dthVFk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons-DZ61nCzv.js","sources":["../src/-private/icons.gts"],"sourcesContent":["/**\n * Icon components shared across Frontile components (buttons, forms,\n * disclosure, navigation, collections, status/notifications). Kept in one\n * place to avoid duplicating the same SVG in multiple component folders.\n */\nimport type { TOC } from '@ember/component/template-only';\n\nexport interface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const IconChevronUpDown: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nexport const IconCalendar: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n\nexport const IconInfo: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"info\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconSuccess: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"success\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconWarning: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"warning\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\"\n />\n </svg>\n</template>;\n\nexport const IconDanger: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"danger\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n"],"names":["ChevronDownIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","ChevronDoubleLeftIcon","ChevronDoubleRightIcon","IconChevronUpDown","IconCalendar","ColumnVisibilityIcon","IconInfo","IconSuccess","IconWarning","IconDanger"],"mappings":";;;;AAAA;;;;;MAWaA,eAAqB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,wQAAA,EAgBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,aAAmB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,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ybAAA,EAiB/C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGY,UAAgB,GAAAf,oBAAA,CAAiBC,kBAAA,CAAA,6UAAA,EAiB9C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
|
|
1
|
+
{"version":3,"file":"icons-55dthVFk.js","sources":["../src/-private/icons.gts"],"sourcesContent":["/**\n * Icon components shared across Frontile components (buttons, forms,\n * disclosure, navigation, collections, status/notifications). Kept in one\n * place to avoid duplicating the same SVG in multiple component folders.\n */\nimport type { TOC } from '@ember/component/template-only';\n\nexport interface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const IconChevronUpDown: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nexport const IconCalendar: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n\nexport const IconInfo: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"info\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconSuccess: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"success\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconWarning: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"warning\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\"\n />\n </svg>\n</template>;\n\nexport const IconDanger: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"danger\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const EllipsisHorizontalIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z\"\n />\n </svg>\n</template>;\n\nexport const SidebarLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M9 4v16\" />\n </svg>\n</template>;\n\nexport const SidebarRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M15 4v16\" />\n </svg>\n</template>;\n\nexport const MenuIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n</template>;\n"],"names":["ChevronDownIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","ChevronDoubleLeftIcon","ChevronDoubleRightIcon","IconChevronUpDown","IconCalendar","ColumnVisibilityIcon","IconInfo","IconSuccess","IconWarning","IconDanger","EllipsisHorizontalIcon","SidebarLeftIcon","SidebarRightIcon","M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CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGU,WAAiB,GAAAb,oBAAA,CAAiBC,kBAAA,CAAA,uUAAA,EAiB/C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGW,WAAiB,GAAAd,oBAAA,CAAiBC,kBAAA,CAAA,ybAAA,EAiB/C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGY,UAAgB,GAAAf,oBAAA,CAAiBC,kBAAA,CAAA,6UAAA,EAiB9C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGa,sBAA4B,GAAAhB,oBAAA,CAAiBC,kBAAA,CAAA,wZAAA,EAkB1D;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGc,eAAqB,GAAAjB,oBAAA,CAAiBC,kBAAA,CAAA,8UAAA,EAiBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGe,gBAAsB,GAAAlB,oBAAA,CAAiBC,kBAAA,CAAA,+UAAA,EAiBpD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGgB,QAAc,GAAAnB,oBAAA,CAAiBC,kBAAA,CAAA,8RAAA,EAgB5C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export { PortalTarget } from './components/overlays/portal-target.js';
|
|
|
54
54
|
export { Popover, PopoverContent } from './components/overlays/popover.js';
|
|
55
55
|
export { Tooltip } from './components/overlays/tooltip.js';
|
|
56
56
|
export { Alert } from './components/status/alert.js';
|
|
57
|
+
export { Badge } from './components/status/badge.js';
|
|
57
58
|
export { ProgressBar } from './components/status/progress-bar.js';
|
|
58
59
|
import 'focus-visible/dist/focus-visible.js';
|
|
59
60
|
export { Avatar } from './components/utilities/avatar.js';
|
|
@@ -70,6 +71,10 @@ export { READY_ATTRIBUTE, selectionIndicator } from './utils/selection-indicator
|
|
|
70
71
|
export { rovingFocus } from './utils/roving-focus.js';
|
|
71
72
|
export { PressEvent, default as press } from './modifiers/press.js';
|
|
72
73
|
export { default as dragToDismiss } from './modifiers/drag-to-dismiss.js';
|
|
74
|
+
export { Stepper } from './components/navigation/stepper/stepper.js';
|
|
75
|
+
export { StepperList } from './components/navigation/stepper/list.js';
|
|
76
|
+
export { StepperStep } from './components/navigation/stepper/step.js';
|
|
77
|
+
export { StepperPanel } from './components/navigation/stepper/panel.js';
|
|
73
78
|
export { Tabs, TabsList } from './components/navigation/tabs/tabs.js';
|
|
74
79
|
export { TabsTab } from './components/navigation/tabs/tab.js';
|
|
75
80
|
export { TabsPanel } from './components/navigation/tabs/panel.js';
|
|
@@ -85,8 +90,21 @@ export { Accordion } from './components/disclosure/accordion/accordion.js';
|
|
|
85
90
|
export { AccordionItem } from './components/disclosure/accordion/item.js';
|
|
86
91
|
import './manager-Dge4r8Vn.js';
|
|
87
92
|
import '@ember/service';
|
|
88
|
-
export { N as NotificationCard } from './notification-card-
|
|
93
|
+
export { N as NotificationCard } from './notification-card-BPfDo-Gf.js';
|
|
89
94
|
export { NotificationsContainer } from './components/notifications/notifications-container.js';
|
|
95
|
+
export { AppLayoutState } from './components/layout/app-layout-state.js';
|
|
96
|
+
export { AppLayout } from './components/layout/app-layout.js';
|
|
97
|
+
export { Aside } from './components/layout/aside.js';
|
|
98
|
+
export { AsideToggle } from './components/layout/aside-toggle.js';
|
|
99
|
+
export { BottomNav } from './components/layout/bottom-nav.js';
|
|
100
|
+
export { BottomNavMore } from './components/layout/bottom-nav-more.js';
|
|
101
|
+
export { Main } from './components/layout/main.js';
|
|
102
|
+
export { MenuToggle } from './components/layout/menu-toggle.js';
|
|
103
|
+
export { Navbar } from './components/layout/navbar.js';
|
|
104
|
+
export { PageHeader } from './components/layout/page-header.js';
|
|
105
|
+
export { Sidebar } from './components/layout/sidebar.js';
|
|
106
|
+
export { SidebarGroup } from './components/layout/sidebar-group.js';
|
|
107
|
+
export { SidebarToggle } from './components/layout/sidebar-toggle.js';
|
|
90
108
|
export { ListboxGroup } from './components/collections/listbox/group.js';
|
|
91
109
|
export { ListboxItem } from './components/collections/listbox/item.js';
|
|
92
110
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { AppLayoutState } from './components/layout/app-layout-state.js';
|
|
2
|
+
export { AppLayout } from './components/layout/app-layout.js';
|
|
3
|
+
export { Aside } from './components/layout/aside.js';
|
|
4
|
+
export { AsideToggle } from './components/layout/aside-toggle.js';
|
|
5
|
+
export { BottomNav } from './components/layout/bottom-nav.js';
|
|
6
|
+
export { BottomNavMore } from './components/layout/bottom-nav-more.js';
|
|
7
|
+
export { Main } from './components/layout/main.js';
|
|
8
|
+
export { MenuToggle } from './components/layout/menu-toggle.js';
|
|
9
|
+
export { Navbar } from './components/layout/navbar.js';
|
|
10
|
+
export { PageHeader } from './components/layout/page-header.js';
|
|
11
|
+
export { Sidebar } from './components/layout/sidebar.js';
|
|
12
|
+
export { SidebarGroup } from './components/layout/sidebar-group.js';
|
|
13
|
+
export { SidebarToggle } from './components/layout/sidebar-toggle.js';
|
|
14
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/navigation.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export { Stepper } from './components/navigation/stepper/stepper.js';
|
|
2
|
+
export { StepperList } from './components/navigation/stepper/list.js';
|
|
3
|
+
export { StepperStep } from './components/navigation/stepper/step.js';
|
|
4
|
+
export { StepperPanel } from './components/navigation/stepper/panel.js';
|
|
1
5
|
export { Tabs, TabsList } from './components/navigation/tabs/tabs.js';
|
|
2
6
|
export { TabsTab } from './components/navigation/tabs/tab.js';
|
|
3
7
|
export { TabsPanel } from './components/navigation/tabs/panel.js';
|
package/dist/navigation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import { fn } from '@ember/helper';
|
|
|
7
7
|
import { CloseButton } from './components/buttons/close-button.js';
|
|
8
8
|
import { Button } from './components/buttons/button.js';
|
|
9
9
|
import { Spinner } from './components/utilities/spinner.js';
|
|
10
|
-
import {
|
|
10
|
+
import { i as IconDanger, j as IconWarning, k as IconSuccess, l as IconInfo } from './icons-55dthVFk.js';
|
|
11
11
|
import { useStyles } from '@frontile/theme';
|
|
12
12
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
13
13
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -330,4 +330,4 @@ class NotificationCard extends Component {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
export { NotificationCard as N, NotificationStack as a };
|
|
333
|
-
//# sourceMappingURL=notification-card-
|
|
333
|
+
//# sourceMappingURL=notification-card-BPfDo-Gf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-card-dz-eE6z9.js","sources":["../src/-private/notification-stack.ts","../src/components/notifications/notification-card.gts"],"sourcesContent":["import type { containerPlacement } from './types';\n\n/**\n * How much each card behind the front of the stack shrinks, as a fraction.\n */\nconst SCALE_STEP = 0.05;\n\n/**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards. Exported so\n * notification-card.gts's own enter/exit slide direction can share this\n * instead of re-deriving it from the placement string.\n */\nfunction isTopPlacement(placement: containerPlacement): boolean {\n return placement.startsWith('top');\n}\n\ninterface NotificationStackInput {\n /**\n * Measured card heights in px, ordered front-first (index 0 is the newest\n * notification). A card that has not been measured yet contributes 0.\n */\n heights: number[];\n\n isExpanded: boolean;\n\n /**\n * Peek offset between collapsed cards, and the gap between expanded cards.\n */\n gap: number;\n\n /**\n * How many cards stay visible while collapsed.\n */\n visibleToasts: number;\n\n placement: containerPlacement;\n}\n\ninterface CardGeometry {\n transform: string;\n zIndex: number;\n opacity: number;\n\n /**\n * Fixed height in px while collapsed, so a taller card behind the front one\n * cannot stick out past it. `null` means the card sizes to its content.\n */\n height: number | null;\n\n transformOrigin: 'top center' | 'bottom center';\n\n /**\n * `'none'` when the card is fully transparent (collapsed beyond\n * `visibleToasts`), so it cannot swallow clicks meant for the page beneath\n * it; `'auto'` otherwise.\n */\n pointerEvents: 'auto' | 'none';\n}\n\n/**\n * Pure geometry for the notification stack: given measured card heights and\n * the current expansion state, it produces the transform for each card and\n * the height the container should animate to.\n *\n * Deliberately free of Ember and DOM dependencies so the layout maths can be\n * tested on its own.\n */\nclass NotificationStack {\n readonly heights: number[];\n readonly isExpanded: boolean;\n readonly gap: number;\n readonly visibleToasts: number;\n readonly placement: containerPlacement;\n\n constructor(input: NotificationStackInput) {\n this.heights = input.heights;\n this.isExpanded = input.isExpanded;\n this.gap = input.gap;\n this.visibleToasts = input.visibleToasts;\n this.placement = input.placement;\n }\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.placement);\n }\n\n /**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards.\n */\n get directionSign(): number {\n return this.isTopPlacement ? 1 : -1;\n }\n\n get transformOrigin(): CardGeometry['transformOrigin'] {\n return this.isTopPlacement ? 'top center' : 'bottom center';\n }\n\n get count(): number {\n return this.heights.length;\n }\n\n get frontHeight(): number {\n return this.heights[0] ?? 0;\n }\n\n geometryFor(index: number): CardGeometry {\n const zIndex = this.count - index;\n\n if (this.isExpanded) {\n return {\n transform: `translateY(${this.directionSign * this.offsetBefore(index)}px) scale(1)`,\n zIndex,\n opacity: 1,\n height: null,\n transformOrigin: this.transformOrigin,\n pointerEvents: 'auto'\n };\n }\n\n const offset = index * this.gap;\n const scale = Math.max(0, 1 - index * SCALE_STEP);\n const isVisible = index < this.visibleToasts;\n\n return {\n transform: `translateY(${this.directionSign * offset}px) scale(${scale})`,\n zIndex,\n opacity: isVisible ? 1 : 0,\n // The front card must size to its own content (`null`). Clamping it to\n // `frontHeight` would be self-referential — `frontHeight` *is* the\n // front card's own measurement — and would permanently lock in\n // whatever height was measured first, before content (e.g. a long\n // description) finished laying out. Only cards behind the front one\n // need clamping, so a taller card further back can't poke out past it.\n height: index === 0 ? null : this.frontHeight,\n transformOrigin: this.transformOrigin,\n // A card past `visibleToasts` is fully transparent while collapsed;\n // without this it would still sit in the fixed-position stack and\n // swallow clicks meant for the page beneath it.\n pointerEvents: isVisible ? 'auto' : 'none'\n };\n }\n\n get containerHeight(): number {\n if (this.count === 0) {\n return 0;\n }\n\n if (this.isExpanded) {\n return this.offsetBefore(this.count) - this.gap;\n }\n\n const visible = Math.min(this.count, this.visibleToasts);\n return this.frontHeight + (visible - 1) * this.gap;\n }\n\n /**\n * Distance from the placement edge to the leading edge of `index`, i.e. the\n * summed heights and gaps of every card in front of it.\n */\n private offsetBefore(index: number): number {\n let offset = 0;\n\n for (let i = 0; i < index; i++) {\n offset += (this.heights[i] ?? 0) + this.gap;\n }\n\n return offset;\n }\n}\n\nexport { NotificationStack, isTopPlacement };\nexport type { NotificationStackInput, CardGeometry };\n","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { fn } from '@ember/helper';\nimport { CloseButton } from '../buttons/close-button';\nimport { Button } from '../buttons/button';\nimport { Spinner } from '../utilities/spinner';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/icons';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../../services/notifications';\nimport type Notification from '../../-private/notification';\nimport { isTopPlacement } from '../../-private/notification-stack';\nimport type { CardGeometry } from '../../-private/notification-stack';\nimport type {\n CustomAction,\n containerPlacement,\n NotificationStatus\n} from '../../-private/types';\nimport type { SafeString } from '@ember/template';\n\n/**\n * Everything that varies by `NotificationStatus`, keyed in one place so\n * adding a status means adding one row here instead of remembering to\n * touch an icon map, an action-colour map, and the `role` getter's cascade\n * separately.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // Button colour for the primary custom action. Also reused as the\n // loading <Spinner>'s `@color` (its colour union has the same\n // neutral/primary/success/warning/danger shape), so the spinner's arc\n // matches the same accent the card's custom action button would use.\n actionColor: 'neutral',\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This coupling is why the prop is\n // `@status` and not `@color`.\n role: 'status'\n },\n // Formerly `info`, which already painted `primary`'s classes. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n actionColor: 'primary',\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n actionColor: 'success',\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n actionColor: 'warning',\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n actionColor: 'danger',\n role: 'alert'\n }\n} as const satisfies Record<\n NotificationStatus,\n {\n icon: unknown;\n actionColor: 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n role: 'status' | 'alert';\n }\n>;\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification<Record<string, unknown>>;\n placement: containerPlacement;\n\n /**\n * The visual style of the card.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * Position, scale, and stacking supplied by the container. When omitted\n * the card renders in place with no stack transform.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n geometry?: CardGeometry;\n\n /**\n * Called with the card's measured height whenever it changes.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n onMeasure?: (height: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n\n /**\n * False for the first frame so the card can transition in from the\n * placement edge rather than appearing at its resting position.\n */\n @tracked hasEntered = false;\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.args.placement || 'bottom-right');\n }\n\n get status(): NotificationStatus {\n return this.args.notification.status;\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n get actionColor() {\n return STATUS_CONFIG[this.status].actionColor;\n }\n\n get role(): 'status' | 'alert' {\n return STATUS_CONFIG[this.status].role;\n }\n\n get style(): SafeString {\n const { geometry, notification } = this.args;\n // The theme owns the whole `transition-duration` shorthand (and its\n // `motion-reduce:` override) so the per-property duration order can\n // never drift out of sync with `transition-[transform,opacity,height]`\n // across the component boundary — see notification-card.ts. This card\n // only supplies the one value `@transitionDuration` actually governs\n // (the enter/exit fade), as a custom property the theme's `var()` reads.\n const declarations = [\n `--frontile-toast-fade: ${notification.transitionDuration}ms`\n ];\n\n // The static edge-pinning (`position: absolute` + `left/right/top` or\n // `bottom`) lives in the `stackPlacement` theme variant (see\n // `this.classes`) rather than here, since it never varies frame to\n // frame — only the geometry-driven parts below (transform, opacity,\n // height, z-index, transform-origin) need to be inline, because a\n // `style` attribute passed through `...attributes` replaces the\n // element's own `style` outright and would drop them.\n\n if (!this.hasEntered || notification.isRemoving) {\n // Enter from, and exit to, the placement edge.\n const offset = this.isTopPlacement ? '-100%' : '100%';\n declarations.push(\n `opacity: 0`,\n `transform: translateY(${offset}) scale(0.95)`,\n // A card can be transparent-and-collapsed the instant it starts\n // exiting; keep it out of the click path either way.\n `pointer-events: none`\n );\n\n if (geometry) {\n declarations.push(\n `z-index: ${geometry.zIndex}`,\n `transform-origin: ${geometry.transformOrigin}`,\n // Preserve the collapsed height clamp through the exit\n // transition — otherwise a non-front collapsed card snaps from\n // its clamped height to `auto` for the slide-out.\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n if (geometry) {\n declarations.push(\n `transform: ${geometry.transform}`,\n `transform-origin: ${geometry.transformOrigin}`,\n `z-index: ${geometry.zIndex}`,\n `opacity: ${geometry.opacity}`,\n `pointer-events: ${geometry.pointerEvents}`,\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n /**\n * Flip to the resting position on the frame after insertion, so the browser\n * has a start value to transition from.\n */\n enter = modifier(() => {\n const frame = requestAnimationFrame(() => {\n this.hasEntered = true;\n });\n\n return () => cancelAnimationFrame(frame);\n });\n\n /**\n * Report the card's height to the container so the stack can lay itself\n * out. Also fires when promise content swaps change the height.\n *\n * `element` is the inner element (never height-constrained, so its\n * `offsetHeight` is always the content's true natural height). The border\n * lives on the outer element (`element.parentElement`), so it isn't part\n * of that number — we add it back via `outer.offsetHeight -\n * outer.clientHeight`, the outer element's vertical border width. That\n * difference is constant whether or not the outer element's height is\n * currently clamped by the collapsed-stack height, so it's safe to read\n * off the outer element even while it's clamped, and it stays correct if\n * the theme's border width ever changes.\n */\n measure = modifier((element: HTMLElement) => {\n const { onMeasure } = this.args;\n\n if (!onMeasure) {\n return;\n }\n\n const outer = element.parentElement as HTMLElement;\n\n const report = () => {\n const outerBorder = outer.offsetHeight - outer.clientHeight;\n onMeasure(element.offsetHeight + outerBorder);\n };\n\n const observer = new ResizeObserver(report);\n\n report();\n observer.observe(element);\n\n return () => observer.disconnect();\n });\n\n remove = () => {\n this.notifications.remove(this.args.notification);\n };\n\n handleClickCustomAction = (customAction: CustomAction) => {\n customAction.onClick();\n this.notifications.remove(this.args.notification);\n };\n\n get classes() {\n const { notificationCard } = useStyles();\n\n const {\n base,\n inner,\n icon,\n spinner,\n content,\n title,\n description,\n customActions,\n customActionButton,\n closeButton\n } = notificationCard({\n status: this.status,\n variant: this.args.variant || 'surface',\n hasDescription: !!this.args.notification.description,\n // Only pin the card to the placement edge once the container has\n // supplied stack geometry — see the `stackPlacement` variant's\n // comment in the theme.\n stackPlacement: this.args.geometry\n ? this.isTopPlacement\n ? 'top'\n : 'bottom'\n : 'none'\n });\n\n return {\n base: base(),\n inner: inner(),\n icon: icon(),\n spinner: spinner(),\n content: content(),\n title: title(),\n description: description(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-inline-styles style-concatenation }}\n <div\n data-component=\"notification-card\"\n data-part=\"base\"\n class={{this.classes.base}}\n style={{this.style}}\n role={{this.role}}\n data-test-notification-card\n data-test-status={{this.status}}\n {{this.enter}}\n ...attributes\n >\n {{! measure reads offsetHeight off this inner element, not the outer one above, since the outer carries the collapsed-stack height clamp. See notification-stack.ts. }}\n <div data-part=\"inner\" class={{this.classes.inner}} {{this.measure}}>\n {{#unless @notification.hideIcon}}\n {{#if @notification.isLoading}}\n <Spinner\n data-part=\"spinner\"\n @class={{this.classes.spinner}}\n @color={{this.actionColor}}\n @size=\"sm\"\n data-test-icon=\"loading\"\n />\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon data-part=\"icon\" class={{this.classes.icon}} />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div data-part=\"content\" class={{this.classes.content}}>\n <div\n data-part=\"title\"\n class={{this.classes.title}}\n >{{@notification.title}}</div>\n\n {{#if @notification.description}}\n <div data-part=\"description\" class={{this.classes.description}}>\n {{@notification.description}}\n </div>\n {{/if}}\n </div>\n\n {{#if @notification.customActions}}\n <div data-part=\"custom-actions\" class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction index|}}\n <Button\n data-part=\"custom-action-button\"\n @size=\"xs\"\n @color={{if index \"neutral\" this.actionColor}}\n @variant={{if index \"plain\" \"solid\"}}\n @class={{this.classes.customActionButton}}\n @onPress={{fn this.handleClickCustomAction customAction}}\n >\n {{customAction.label}}\n </Button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n data-part=\"close-button\"\n @onPress={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["SCALE_STEP","isTopPlacement","placement","startsWith","NotificationStack","heights","isExpanded","gap","visibleToasts","constructor","input","directionSign","transformOrigin","count","length","frontHeight","geometryFor","index","zIndex","transform","offsetBefore","opacity","height","pointerEvents","offset","scale","Math","max","isVisible","containerHeight","visible","min","i","STATUS_CONFIG","neutral","icon","IconInfo","actionColor","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","NotificationCard","Component","g","prototype","service","tracked","args","status","notification","style","geometry","declarations","transitionDuration","hasEntered","isRemoving","push","htmlSafe","join","enter","modifier","frame","requestAnimationFrame","cancelAnimationFrame","measure","element","onMeasure","outer","parentElement","report","outerBorder","offsetHeight","clientHeight","observer","ResizeObserver","observe","disconnect","remove","notifications","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","inner","spinner","content","title","description","customActions","customActionButton","closeButton","variant","hasDescription","stackPlacement","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","Button","fn","CloseButton"],"mappings":";;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,IAAI;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,SAA6B,EAAW;AAC9D,EAAA,OAAOA,SAAS,CAACC,UAAU,CAAC,KAAK,CAAC;AACpC;AA6CA;A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M;AACnB8C,MAAAA,OAAA,EAAS,IAAI,CAAC/C,IAAI,CAAC+C,OAAO,IAAI,SAAA;MAC9BC,cAAA,EAAgB,CAAC,CAAC,IAAI,CAAChD,IAAI,CAACE,YAAY,CAACyC,WAAW;AACpD;AACA;AACA;AACAM,MAAAA,cAAA,EAAgB,IAAI,CAACjD,IAAI,CAACI,QAAQ,GAC9B,IAAI,CAACvD,cAAc,GACjB,KAAA,GACA,QAAA,GACF;AACN,KAAA,CAAA;IAEA,OAAO;MACLyF,IAAA,EAAMA,IAAA,EAAA;MACNC,KAAA,EAAOA,KAAA,EAAA;MACPxD,IAAA,EAAMA,IAAA,EAAA;MACNyD,OAAA,EAASA,OAAA,EAAA;MACTC,OAAA,EAASA,OAAA,EAAA;MACTC,KAAA,EAAOA,KAAA,EAAA;MACPC,WAAA,EAAaA,WAAA,EAAA;MACbC,aAAA,EAAeA,aAAA,EAAA;MACfC,kBAAA,EAAoBA,kBAAA,EAAA;MACpBC,WAAA,EAAaA,WAAA;KACf;AACF,EAAA;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,ggEAAA,EAuEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"notification-card-BPfDo-Gf.js","sources":["../src/-private/notification-stack.ts","../src/components/notifications/notification-card.gts"],"sourcesContent":["import type { containerPlacement } from './types';\n\n/**\n * How much each card behind the front of the stack shrinks, as a fraction.\n */\nconst SCALE_STEP = 0.05;\n\n/**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards. Exported so\n * notification-card.gts's own enter/exit slide direction can share this\n * instead of re-deriving it from the placement string.\n */\nfunction isTopPlacement(placement: containerPlacement): boolean {\n return placement.startsWith('top');\n}\n\ninterface NotificationStackInput {\n /**\n * Measured card heights in px, ordered front-first (index 0 is the newest\n * notification). A card that has not been measured yet contributes 0.\n */\n heights: number[];\n\n isExpanded: boolean;\n\n /**\n * Peek offset between collapsed cards, and the gap between expanded cards.\n */\n gap: number;\n\n /**\n * How many cards stay visible while collapsed.\n */\n visibleToasts: number;\n\n placement: containerPlacement;\n}\n\ninterface CardGeometry {\n transform: string;\n zIndex: number;\n opacity: number;\n\n /**\n * Fixed height in px while collapsed, so a taller card behind the front one\n * cannot stick out past it. `null` means the card sizes to its content.\n */\n height: number | null;\n\n transformOrigin: 'top center' | 'bottom center';\n\n /**\n * `'none'` when the card is fully transparent (collapsed beyond\n * `visibleToasts`), so it cannot swallow clicks meant for the page beneath\n * it; `'auto'` otherwise.\n */\n pointerEvents: 'auto' | 'none';\n}\n\n/**\n * Pure geometry for the notification stack: given measured card heights and\n * the current expansion state, it produces the transform for each card and\n * the height the container should animate to.\n *\n * Deliberately free of Ember and DOM dependencies so the layout maths can be\n * tested on its own.\n */\nclass NotificationStack {\n readonly heights: number[];\n readonly isExpanded: boolean;\n readonly gap: number;\n readonly visibleToasts: number;\n readonly placement: containerPlacement;\n\n constructor(input: NotificationStackInput) {\n this.heights = input.heights;\n this.isExpanded = input.isExpanded;\n this.gap = input.gap;\n this.visibleToasts = input.visibleToasts;\n this.placement = input.placement;\n }\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.placement);\n }\n\n /**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards.\n */\n get directionSign(): number {\n return this.isTopPlacement ? 1 : -1;\n }\n\n get transformOrigin(): CardGeometry['transformOrigin'] {\n return this.isTopPlacement ? 'top center' : 'bottom center';\n }\n\n get count(): number {\n return this.heights.length;\n }\n\n get frontHeight(): number {\n return this.heights[0] ?? 0;\n }\n\n geometryFor(index: number): CardGeometry {\n const zIndex = this.count - index;\n\n if (this.isExpanded) {\n return {\n transform: `translateY(${this.directionSign * this.offsetBefore(index)}px) scale(1)`,\n zIndex,\n opacity: 1,\n height: null,\n transformOrigin: this.transformOrigin,\n pointerEvents: 'auto'\n };\n }\n\n const offset = index * this.gap;\n const scale = Math.max(0, 1 - index * SCALE_STEP);\n const isVisible = index < this.visibleToasts;\n\n return {\n transform: `translateY(${this.directionSign * offset}px) scale(${scale})`,\n zIndex,\n opacity: isVisible ? 1 : 0,\n // The front card must size to its own content (`null`). Clamping it to\n // `frontHeight` would be self-referential — `frontHeight` *is* the\n // front card's own measurement — and would permanently lock in\n // whatever height was measured first, before content (e.g. a long\n // description) finished laying out. Only cards behind the front one\n // need clamping, so a taller card further back can't poke out past it.\n height: index === 0 ? null : this.frontHeight,\n transformOrigin: this.transformOrigin,\n // A card past `visibleToasts` is fully transparent while collapsed;\n // without this it would still sit in the fixed-position stack and\n // swallow clicks meant for the page beneath it.\n pointerEvents: isVisible ? 'auto' : 'none'\n };\n }\n\n get containerHeight(): number {\n if (this.count === 0) {\n return 0;\n }\n\n if (this.isExpanded) {\n return this.offsetBefore(this.count) - this.gap;\n }\n\n const visible = Math.min(this.count, this.visibleToasts);\n return this.frontHeight + (visible - 1) * this.gap;\n }\n\n /**\n * Distance from the placement edge to the leading edge of `index`, i.e. the\n * summed heights and gaps of every card in front of it.\n */\n private offsetBefore(index: number): number {\n let offset = 0;\n\n for (let i = 0; i < index; i++) {\n offset += (this.heights[i] ?? 0) + this.gap;\n }\n\n return offset;\n }\n}\n\nexport { NotificationStack, isTopPlacement };\nexport type { NotificationStackInput, CardGeometry };\n","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { fn } from '@ember/helper';\nimport { CloseButton } from '../buttons/close-button';\nimport { Button } from '../buttons/button';\nimport { Spinner } from '../utilities/spinner';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/icons';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../../services/notifications';\nimport type Notification from '../../-private/notification';\nimport { isTopPlacement } from '../../-private/notification-stack';\nimport type { CardGeometry } from '../../-private/notification-stack';\nimport type {\n CustomAction,\n containerPlacement,\n NotificationStatus\n} from '../../-private/types';\nimport type { SafeString } from '@ember/template';\n\n/**\n * Everything that varies by `NotificationStatus`, keyed in one place so\n * adding a status means adding one row here instead of remembering to\n * touch an icon map, an action-colour map, and the `role` getter's cascade\n * separately.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // Button colour for the primary custom action. Also reused as the\n // loading <Spinner>'s `@color` (its colour union has the same\n // neutral/primary/success/warning/danger shape), so the spinner's arc\n // matches the same accent the card's custom action button would use.\n actionColor: 'neutral',\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This coupling is why the prop is\n // `@status` and not `@color`.\n role: 'status'\n },\n // Formerly `info`, which already painted `primary`'s classes. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n actionColor: 'primary',\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n actionColor: 'success',\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n actionColor: 'warning',\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n actionColor: 'danger',\n role: 'alert'\n }\n} as const satisfies Record<\n NotificationStatus,\n {\n icon: unknown;\n actionColor: 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n role: 'status' | 'alert';\n }\n>;\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification<Record<string, unknown>>;\n placement: containerPlacement;\n\n /**\n * The visual style of the card.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * Position, scale, and stacking supplied by the container. When omitted\n * the card renders in place with no stack transform.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n geometry?: CardGeometry;\n\n /**\n * Called with the card's measured height whenever it changes.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n onMeasure?: (height: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n\n /**\n * False for the first frame so the card can transition in from the\n * placement edge rather than appearing at its resting position.\n */\n @tracked hasEntered = false;\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.args.placement || 'bottom-right');\n }\n\n get status(): NotificationStatus {\n return this.args.notification.status;\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n get actionColor() {\n return STATUS_CONFIG[this.status].actionColor;\n }\n\n get role(): 'status' | 'alert' {\n return STATUS_CONFIG[this.status].role;\n }\n\n get style(): SafeString {\n const { geometry, notification } = this.args;\n // The theme owns the whole `transition-duration` shorthand (and its\n // `motion-reduce:` override) so the per-property duration order can\n // never drift out of sync with `transition-[transform,opacity,height]`\n // across the component boundary — see notification-card.ts. This card\n // only supplies the one value `@transitionDuration` actually governs\n // (the enter/exit fade), as a custom property the theme's `var()` reads.\n const declarations = [\n `--frontile-toast-fade: ${notification.transitionDuration}ms`\n ];\n\n // The static edge-pinning (`position: absolute` + `left/right/top` or\n // `bottom`) lives in the `stackPlacement` theme variant (see\n // `this.classes`) rather than here, since it never varies frame to\n // frame — only the geometry-driven parts below (transform, opacity,\n // height, z-index, transform-origin) need to be inline, because a\n // `style` attribute passed through `...attributes` replaces the\n // element's own `style` outright and would drop them.\n\n if (!this.hasEntered || notification.isRemoving) {\n // Enter from, and exit to, the placement edge.\n const offset = this.isTopPlacement ? '-100%' : '100%';\n declarations.push(\n `opacity: 0`,\n `transform: translateY(${offset}) scale(0.95)`,\n // A card can be transparent-and-collapsed the instant it starts\n // exiting; keep it out of the click path either way.\n `pointer-events: none`\n );\n\n if (geometry) {\n declarations.push(\n `z-index: ${geometry.zIndex}`,\n `transform-origin: ${geometry.transformOrigin}`,\n // Preserve the collapsed height clamp through the exit\n // transition — otherwise a non-front collapsed card snaps from\n // its clamped height to `auto` for the slide-out.\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n if (geometry) {\n declarations.push(\n `transform: ${geometry.transform}`,\n `transform-origin: ${geometry.transformOrigin}`,\n `z-index: ${geometry.zIndex}`,\n `opacity: ${geometry.opacity}`,\n `pointer-events: ${geometry.pointerEvents}`,\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n /**\n * Flip to the resting position on the frame after insertion, so the browser\n * has a start value to transition from.\n */\n enter = modifier(() => {\n const frame = requestAnimationFrame(() => {\n this.hasEntered = true;\n });\n\n return () => cancelAnimationFrame(frame);\n });\n\n /**\n * Report the card's height to the container so the stack can lay itself\n * out. Also fires when promise content swaps change the height.\n *\n * `element` is the inner element (never height-constrained, so its\n * `offsetHeight` is always the content's true natural height). The border\n * lives on the outer element (`element.parentElement`), so it isn't part\n * of that number — we add it back via `outer.offsetHeight -\n * outer.clientHeight`, the outer element's vertical border width. That\n * difference is constant whether or not the outer element's height is\n * currently clamped by the collapsed-stack height, so it's safe to read\n * off the outer element even while it's clamped, and it stays correct if\n * the theme's border width ever changes.\n */\n measure = modifier((element: HTMLElement) => {\n const { onMeasure } = this.args;\n\n if (!onMeasure) {\n return;\n }\n\n const outer = element.parentElement as HTMLElement;\n\n const report = () => {\n const outerBorder = outer.offsetHeight - outer.clientHeight;\n onMeasure(element.offsetHeight + outerBorder);\n };\n\n const observer = new ResizeObserver(report);\n\n report();\n observer.observe(element);\n\n return () => observer.disconnect();\n });\n\n remove = () => {\n this.notifications.remove(this.args.notification);\n };\n\n handleClickCustomAction = (customAction: CustomAction) => {\n customAction.onClick();\n this.notifications.remove(this.args.notification);\n };\n\n get classes() {\n const { notificationCard } = useStyles();\n\n const {\n base,\n inner,\n icon,\n spinner,\n content,\n title,\n description,\n customActions,\n customActionButton,\n closeButton\n } = notificationCard({\n status: this.status,\n variant: this.args.variant || 'surface',\n hasDescription: !!this.args.notification.description,\n // Only pin the card to the placement edge once the container has\n // supplied stack geometry — see the `stackPlacement` variant's\n // comment in the theme.\n stackPlacement: this.args.geometry\n ? this.isTopPlacement\n ? 'top'\n : 'bottom'\n : 'none'\n });\n\n return {\n base: base(),\n inner: inner(),\n icon: icon(),\n spinner: spinner(),\n content: content(),\n title: title(),\n description: description(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-inline-styles style-concatenation }}\n <div\n data-component=\"notification-card\"\n data-part=\"base\"\n class={{this.classes.base}}\n style={{this.style}}\n role={{this.role}}\n data-test-notification-card\n data-test-status={{this.status}}\n {{this.enter}}\n ...attributes\n >\n {{! measure reads offsetHeight off this inner element, not the outer one above, since the outer carries the collapsed-stack height clamp. See notification-stack.ts. }}\n <div data-part=\"inner\" class={{this.classes.inner}} {{this.measure}}>\n {{#unless @notification.hideIcon}}\n {{#if @notification.isLoading}}\n <Spinner\n data-part=\"spinner\"\n @class={{this.classes.spinner}}\n @color={{this.actionColor}}\n @size=\"sm\"\n data-test-icon=\"loading\"\n />\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon data-part=\"icon\" class={{this.classes.icon}} />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div data-part=\"content\" class={{this.classes.content}}>\n <div\n data-part=\"title\"\n class={{this.classes.title}}\n >{{@notification.title}}</div>\n\n {{#if @notification.description}}\n <div data-part=\"description\" class={{this.classes.description}}>\n {{@notification.description}}\n </div>\n {{/if}}\n </div>\n\n {{#if @notification.customActions}}\n <div data-part=\"custom-actions\" class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction index|}}\n <Button\n data-part=\"custom-action-button\"\n @size=\"xs\"\n @color={{if index \"neutral\" this.actionColor}}\n @variant={{if index \"plain\" \"solid\"}}\n @class={{this.classes.customActionButton}}\n @onPress={{fn this.handleClickCustomAction customAction}}\n >\n {{customAction.label}}\n </Button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n data-part=\"close-button\"\n @onPress={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["SCALE_STEP","isTopPlacement","placement","startsWith","NotificationStack","heights","isExpanded","gap","visibleToasts","constructor","input","directionSign","transformOrigin","count","length","frontHeight","geometryFor","index","zIndex","transform","offsetBefore","opacity","height","pointerEvents","offset","scale","Math","max","isVisible","containerHeight","visible","min","i","STATUS_CONFIG","neutral","icon","IconInfo","actionColor","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","NotificationCard","Component","g","prototype","service","tracked","args","status","notification","style","geometry","declarations","transitionDuration","hasEntered","isRemoving","push","htmlSafe","join","enter","modifier","frame","requestAnimationFrame","cancelAnimationFrame","measure","element","onMeasure","outer","parentElement","report","outerBorder","offsetHeight","clientHeight","observer","ResizeObserver","observe","disconnect","remove","notifications","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","inner","spinner","content","title","description","customActions","customActionButton","closeButton","variant","hasDescription","stackPlacement","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","Button","fn","CloseButton"],"mappings":";;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,IAAI;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,SAA6B,EAAW;AAC9D,EAAA,OAAOA,SAAS,CAACC,UAAU,CAAC,KAAK,CAAC;AACpC;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,CAAC;EACbC,OAAO;EACPC,UAAU;EACVC,GAAG;EACHC,aAAa;EACbN,SAAS;EAElBO,WAAWA,CAACC,KAA6B,EAAE;AACzC,IAAA,IAAI,CAACL,OAAO,GAAGK,KAAK,CAACL,OAAO;AAC5B,IAAA,IAAI,CAACC,UAAU,G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I,CAACvD,cAAc,GACjB,KAAA,GACA,QAAA,GACF;AACN,KAAA,CAAA;IAEA,OAAO;MACLyF,IAAA,EAAMA,IAAA,EAAA;MACNC,KAAA,EAAOA,KAAA,EAAA;MACPxD,IAAA,EAAMA,IAAA,EAAA;MACNyD,OAAA,EAASA,OAAA,EAAA;MACTC,OAAA,EAASA,OAAA,EAAA;MACTC,KAAA,EAAOA,KAAA,EAAA;MACPC,WAAA,EAAaA,WAAA,EAAA;MACbC,aAAA,EAAeA,aAAA,EAAA;MACfC,kBAAA,EAAoBA,kBAAA,EAAA;MACpBC,WAAA,EAAaA,WAAA;KACf;AACF,EAAA;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,ggEAAA,EAuEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
package/dist/notifications.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { N as Notification, T as Timer } from './manager-Dge4r8Vn.js';
|
|
2
2
|
import '@ember/service';
|
|
3
|
-
export { N as NotificationCard, a as NotificationStack } from './notification-card-
|
|
3
|
+
export { N as NotificationCard, a as NotificationStack } from './notification-card-BPfDo-Gf.js';
|
|
4
4
|
export { NotificationsContainer } from './components/notifications/notifications-container.js';
|
|
5
5
|
//# sourceMappingURL=notifications.js.map
|
package/dist/status.js
CHANGED
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The layout breakpoints, matching Tailwind's `sm`, `md` and `lg` screens.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const WIDTHS = {
|
|
6
|
+
sm: '40rem',
|
|
7
|
+
md: '48rem',
|
|
8
|
+
lg: '64rem'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* "Below the breakpoint" is the exact complement of Tailwind's
|
|
13
|
+
* `md:` (`min-width: 48rem`): subtracting 0.02px leaves no width at which
|
|
14
|
+
* both or neither match, without assuming a root font size.
|
|
15
|
+
*/
|
|
16
|
+
function query(breakpoint) {
|
|
17
|
+
return `(max-width: calc(${WIDTHS[breakpoint]} - 0.02px))`;
|
|
18
|
+
}
|
|
19
|
+
function mediaQueryList(breakpoint) {
|
|
20
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return window.matchMedia(query(breakpoint));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether the viewport is narrower than `breakpoint`. `false` where
|
|
28
|
+
* `matchMedia` is unavailable, so callers fall back to the desktop layout.
|
|
29
|
+
*/
|
|
30
|
+
function isBelowBreakpoint(breakpoint) {
|
|
31
|
+
return mediaQueryList(breakpoint)?.matches ?? false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Calls `callback` with the new answer whenever the viewport crosses
|
|
36
|
+
* `breakpoint`. Returns a function that stops watching. A no-op where
|
|
37
|
+
* `matchMedia` is unavailable.
|
|
38
|
+
*/
|
|
39
|
+
function watchBreakpoint(breakpoint, callback) {
|
|
40
|
+
const mql = mediaQueryList(breakpoint);
|
|
41
|
+
if (!mql) {
|
|
42
|
+
return () => {};
|
|
43
|
+
}
|
|
44
|
+
const listener = event => callback(event.matches);
|
|
45
|
+
if (typeof mql.addEventListener === 'function') {
|
|
46
|
+
mql.addEventListener('change', listener);
|
|
47
|
+
return () => mql.removeEventListener('change', listener);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Safari < 14.
|
|
51
|
+
mql.addListener(listener);
|
|
52
|
+
return () => mql.removeListener(listener);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { isBelowBreakpoint, watchBreakpoint };
|
|
56
|
+
//# sourceMappingURL=breakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoint.js","sources":["../../src/utils/breakpoint.ts"],"sourcesContent":["/**\n * The layout breakpoints, matching Tailwind's `sm`, `md` and `lg` screens.\n */\nexport type Breakpoint = 'sm' | 'md' | 'lg';\n\nconst WIDTHS: Record<Breakpoint, string> = {\n sm: '40rem',\n md: '48rem',\n lg: '64rem'\n};\n\n/**\n * \"Below the breakpoint\" is the exact complement of Tailwind's\n * `md:` (`min-width: 48rem`): subtracting 0.02px leaves no width at which\n * both or neither match, without assuming a root font size.\n */\nfunction query(breakpoint: Breakpoint): string {\n return `(max-width: calc(${WIDTHS[breakpoint]} - 0.02px))`;\n}\n\nfunction mediaQueryList(breakpoint: Breakpoint): MediaQueryList | undefined {\n if (\n typeof window === 'undefined' ||\n typeof window.matchMedia !== 'function'\n ) {\n return undefined;\n }\n return window.matchMedia(query(breakpoint));\n}\n\n/**\n * Whether the viewport is narrower than `breakpoint`. `false` where\n * `matchMedia` is unavailable, so callers fall back to the desktop layout.\n */\nexport function isBelowBreakpoint(breakpoint: Breakpoint): boolean {\n return mediaQueryList(breakpoint)?.matches ?? false;\n}\n\n/**\n * Calls `callback` with the new answer whenever the viewport crosses\n * `breakpoint`. Returns a function that stops watching. A no-op where\n * `matchMedia` is unavailable.\n */\nexport function watchBreakpoint(\n breakpoint: Breakpoint,\n callback: (below: boolean) => void\n): () => void {\n const mql = mediaQueryList(breakpoint);\n if (!mql) {\n return () => {};\n }\n\n const listener = (event: MediaQueryListEvent): void =>\n callback(event.matches);\n\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', listener);\n return () => mql.removeEventListener('change', listener);\n }\n\n // Safari < 14.\n mql.addListener(listener);\n return () => mql.removeListener(listener);\n}\n"],"names":["WIDTHS","sm","md","lg","query","breakpoint","mediaQueryList","window","matchMedia","undefined","isBelowBreakpoint","matches","watchBreakpoint","callback","mql","listener","event","addEventListener","removeEventListener","addListener","removeListener"],"mappings":"AAAA;AACA;AACA;;AAGA,MAAMA,MAAkC,GAAG;AACzCC,EAAAA,EAAE,EAAE,OAAO;AACXC,EAAAA,EAAE,EAAE,OAAO;AACXC,EAAAA,EAAE,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAACC,UAAsB,EAAU;AAC7C,EAAA,OAAO,CAAA,iBAAA,EAAoBL,MAAM,CAACK,UAAU,CAAC,CAAA,WAAA,CAAa;AAC5D;AAEA,SAASC,cAAcA,CAACD,UAAsB,EAA8B;EAC1E,IACE,OAAOE,MAAM,KAAK,WAAW,IAC7B,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,EACvC;AACA,IAAA,OAAOC,SAAS;AAClB,EAAA;EACA,OAAOF,MAAM,CAACC,UAAU,CAACJ,KAAK,CAACC,UAAU,CAAC,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACO,SAASK,iBAAiBA,CAACL,UAAsB,EAAW;AACjE,EAAA,OAAOC,cAAc,CAACD,UAAU,CAAC,EAAEM,OAAO,IAAI,KAAK;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAC7BP,UAAsB,EACtBQ,QAAkC,EACtB;AACZ,EAAA,MAAMC,GAAG,GAAGR,cAAc,CAACD,UAAU,CAAC;EACtC,IAAI,CAACS,GAAG,EAAE;IACR,OAAO,MAAM,CAAC,CAAC;AACjB,EAAA;EAEA,MAAMC,QAAQ,GAAIC,KAA0B,IAC1CH,QAAQ,CAACG,KAAK,CAACL,OAAO,CAAC;AAEzB,EAAA,IAAI,OAAOG,GAAG,CAACG,gBAAgB,KAAK,UAAU,EAAE;AAC9CH,IAAAA,GAAG,CAACG,gBAAgB,CAAC,QAAQ,EAAEF,QAAQ,CAAC;IACxC,OAAO,MAAMD,GAAG,CAACI,mBAAmB,CAAC,QAAQ,EAAEH,QAAQ,CAAC;AAC1D,EAAA;;AAEA;AACAD,EAAAA,GAAG,CAACK,WAAW,CAACJ,QAAQ,CAAC;AACzB,EAAA,OAAO,MAAMD,GAAG,CAACM,cAAc,CAACL,QAAQ,CAAC;AAC3C;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The global `document`, or `undefined` where there is none (FastBoot, SSR,
|
|
3
|
+
* prerender).
|
|
4
|
+
*/
|
|
5
|
+
function globalDocument() {
|
|
6
|
+
return typeof document === 'undefined' ? undefined : document;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { globalDocument };
|
|
10
|
+
//# sourceMappingURL=document-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-listener.js","sources":["../../src/utils/document-listener.ts"],"sourcesContent":["/**\n * The global `document`, or `undefined` where there is none (FastBoot, SSR,\n * prerender).\n */\nexport function globalDocument(): Document | undefined {\n return typeof document === 'undefined' ? undefined : document;\n}\n"],"names":["globalDocument","document","undefined"],"mappings":"AAAA;AACA;AACA;AACA;AACO,SAASA,cAAcA,GAAyB;AACrD,EAAA,OAAO,OAAOC,QAAQ,KAAK,WAAW,GAAGC,SAAS,GAAGD,QAAQ;AAC/D;;"}
|
|
@@ -90,6 +90,13 @@ class ListItem {
|
|
|
90
90
|
get isDisabledUntracked() {
|
|
91
91
|
return this.isDisabledMirror;
|
|
92
92
|
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Disabled by the item itself (`setupItem`'s `isDisabled`), on top of the
|
|
96
|
+
* manager's `disabledKeys`. Fixed at registration like `item`: a change
|
|
97
|
+
* re-runs `setupItem`, which registers a fresh item.
|
|
98
|
+
*/
|
|
99
|
+
isDisabledByItem = false;
|
|
93
100
|
constructor(el, args) {
|
|
94
101
|
this.el = el;
|
|
95
102
|
this.key = args.key;
|
|
@@ -392,7 +399,7 @@ class ListManager {
|
|
|
392
399
|
for (let i = 0; i < this.#items.length; i++) {
|
|
393
400
|
const item = this.#items[i];
|
|
394
401
|
item.isSelected = this.isKeySelected(item.key);
|
|
395
|
-
item.isDisabled = this.isKeyDisabled(item.key);
|
|
402
|
+
item.isDisabled = item.isDisabledByItem || this.isKeyDisabled(item.key);
|
|
396
403
|
}
|
|
397
404
|
|
|
398
405
|
// Callbacks are replaced whenever the caller *mentions* them, rather than
|
|
@@ -678,10 +685,13 @@ class ListManager {
|
|
|
678
685
|
textValue: textValue || '',
|
|
679
686
|
item: args.item,
|
|
680
687
|
isActive: false,
|
|
681
|
-
isDisabled: this.isKeyDisabled(args.key),
|
|
688
|
+
isDisabled: Boolean(args.isDisabled) || this.isKeyDisabled(args.key),
|
|
682
689
|
isSelected: this.isKeySelected(args.key)
|
|
683
690
|
});
|
|
684
691
|
const item = this.at(el);
|
|
692
|
+
if (item) {
|
|
693
|
+
item.isDisabledByItem = Boolean(args.isDisabled);
|
|
694
|
+
}
|
|
685
695
|
if (item && typeof args.onRegister === 'function') {
|
|
686
696
|
args.onRegister(item);
|
|
687
697
|
}
|