@warp-ds/elements 2.2.0-next.8 → 2.2.0
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 +188 -26
- package/dist/.storybook/utilities.js +52 -0
- package/dist/api.js +1 -1
- package/dist/api.js.map +4 -4
- package/dist/custom-elements.json +1517 -2876
- package/dist/index.d.ts +942 -25
- package/dist/packages/affix/affix.react.stories.d.ts +9 -0
- package/dist/packages/affix/affix.react.stories.js +10 -0
- package/dist/packages/affix/affix.stories.js +25 -0
- package/dist/packages/affix/affix.test.js +9 -0
- package/dist/packages/affix/index.d.ts +0 -17
- package/dist/packages/affix/index.js +5 -5
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/affix/react.d.ts +1 -1
- package/dist/packages/affix/react.js +15 -2482
- package/dist/packages/affix/styles.js +2 -0
- package/dist/packages/alert/alert.react.stories.d.ts +13 -0
- package/dist/packages/alert/alert.react.stories.js +44 -0
- package/dist/packages/alert/alert.stories.js +68 -0
- package/dist/packages/alert/alert.test.js +18 -0
- package/dist/packages/alert/index.d.ts +1 -6
- package/dist/packages/alert/index.js +4 -4
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/alert/react.d.ts +1 -1
- package/dist/packages/alert/react.js +11 -2492
- package/dist/packages/alert/styles.js +2 -0
- package/dist/packages/attention/attention.react.stories.d.ts +15 -0
- package/dist/packages/attention/attention.react.stories.js +92 -0
- package/dist/packages/attention/attention.stories.d.ts +6 -0
- package/dist/packages/attention/attention.stories.js +180 -0
- package/dist/packages/attention/attention.test.js +11 -0
- package/dist/packages/attention/index.d.ts +24 -91
- package/dist/packages/attention/index.js +3585 -17
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/layout-styles.js +905 -0
- package/dist/packages/attention/locales/da/messages.mjs +1 -0
- package/dist/packages/attention/locales/en/messages.mjs +1 -0
- package/dist/packages/attention/locales/fi/messages.mjs +1 -0
- package/dist/packages/attention/locales/nb/messages.mjs +1 -0
- package/dist/packages/attention/locales/sv/messages.mjs +1 -0
- package/dist/packages/attention/react.d.ts +15 -0
- package/dist/packages/attention/react.js +17 -0
- package/dist/packages/attention/styles.js +2 -0
- package/dist/packages/badge/badge.react.stories.d.ts +18 -0
- package/dist/packages/badge/badge.react.stories.js +60 -0
- package/dist/packages/badge/badge.stories.js +68 -0
- package/dist/packages/badge/badge.test.js +9 -0
- package/dist/packages/badge/index.d.ts +0 -5
- package/dist/packages/badge/index.js +1 -1
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/badge/react.d.ts +1 -1
- package/dist/packages/badge/react.js +11 -2465
- package/dist/packages/badge/styles.js +2 -0
- package/dist/packages/box/box.react.stories.d.ts +15 -0
- package/dist/packages/box/box.react.stories.js +45 -0
- package/dist/packages/box/box.stories.js +59 -0
- package/dist/packages/box/box.test.js +9 -0
- package/dist/packages/box/index.d.ts +0 -5
- package/dist/packages/box/index.js +11 -4
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/box/react.d.ts +1 -1
- package/dist/packages/box/react.js +11 -2465
- package/dist/packages/box/slot.test.js +9 -0
- package/dist/packages/box/styles.js +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +13 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +40 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +60 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +16 -0
- package/dist/packages/breadcrumbs/index.d.ts +0 -12
- package/dist/packages/breadcrumbs/index.js +6 -6
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/en/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/fi/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/nb/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/sv/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/react.d.ts +1 -1
- package/dist/packages/breadcrumbs/react.js +11 -2475
- package/dist/packages/breadcrumbs/styles.js +2 -0
- package/dist/packages/button/button.react.stories.d.ts +22 -0
- package/dist/packages/button/button.react.stories.js +102 -0
- package/dist/packages/button/button.stories.d.ts +4 -0
- package/dist/packages/button/button.stories.js +151 -0
- package/dist/packages/button/button.test.js +25 -0
- package/dist/packages/button/index.d.ts +0 -66
- package/dist/packages/button/index.js +17 -11
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.mjs +1 -0
- package/dist/packages/button/locales/en/messages.mjs +1 -0
- package/dist/packages/button/locales/fi/messages.mjs +1 -0
- package/dist/packages/button/locales/nb/messages.mjs +1 -0
- package/dist/packages/button/locales/sv/messages.mjs +1 -0
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/button/react.js +10 -2684
- package/dist/packages/button/styles.js +2 -0
- package/dist/packages/card/card.react.stories.d.ts +16 -0
- package/dist/packages/card/card.react.stories.js +63 -0
- package/dist/packages/card/card.stories.js +82 -0
- package/dist/packages/card/card.test.js +9 -0
- package/dist/packages/card/index.d.ts +1 -18
- package/dist/packages/card/index.js +4 -4
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/card/locales/da/messages.mjs +1 -0
- package/dist/packages/card/locales/en/messages.mjs +1 -0
- package/dist/packages/card/locales/fi/messages.mjs +1 -0
- package/dist/packages/card/locales/nb/messages.mjs +1 -0
- package/dist/packages/card/locales/sv/messages.mjs +1 -0
- package/dist/packages/card/react.d.ts +1 -1
- package/dist/packages/card/react.js +11 -2487
- package/dist/packages/card/styles.js +2 -0
- package/dist/packages/expandable/expandable.react.stories.d.ts +18 -0
- package/dist/packages/expandable/expandable.react.stories.js +103 -0
- package/dist/packages/expandable/expandable.stories.js +132 -0
- package/dist/packages/expandable/expandable.test.js +24 -0
- package/dist/packages/expandable/index.d.ts +2 -33
- package/dist/packages/expandable/index.js +20 -11
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/expandable/react.js +11 -2495
- package/dist/packages/expandable/styles.js +2 -0
- package/dist/packages/i18n.js +45 -0
- package/dist/packages/link/index.d.ts +0 -5
- package/dist/packages/link/index.js +93 -2640
- package/dist/packages/link/styles.js +200 -0
- package/dist/packages/modal/index.js +24 -41
- package/dist/packages/modal/index.js.map +4 -4
- package/dist/packages/modal/locales/da/messages.mjs +1 -0
- package/dist/packages/modal/locales/en/messages.mjs +1 -0
- package/dist/packages/modal/locales/fi/messages.mjs +1 -0
- package/dist/packages/modal/locales/nb/messages.mjs +1 -0
- package/dist/packages/modal/locales/sv/messages.mjs +1 -0
- package/dist/packages/modal/modal-footer.d.ts +0 -5
- package/dist/packages/{dead-toggle/index.js → modal/modal-footer.js} +20 -47
- package/dist/packages/modal/modal-footer.js.map +7 -0
- package/dist/packages/modal/modal-header.d.ts +0 -5
- package/dist/packages/{steps/index.js → modal/modal-header.js} +122 -20
- package/dist/packages/modal/modal-header.js.map +7 -0
- package/dist/packages/modal/modal-main.d.ts +0 -5
- package/dist/packages/{dead-toggle/react.js → modal/modal-main.js} +124 -59
- package/dist/packages/{box/react.js.map → modal/modal-main.js.map} +4 -4
- package/dist/packages/modal/modal.react.stories.d.ts +14 -0
- package/dist/packages/modal/modal.react.stories.js +27 -0
- package/dist/packages/modal/modal.stories.d.ts +3 -3
- package/dist/packages/modal/modal.stories.js +254 -0
- package/dist/packages/modal/react.d.ts +11 -3
- package/dist/packages/modal/react.js +31 -2754
- package/dist/packages/modal/util.js +21 -0
- package/dist/packages/pill/index.d.ts +0 -17
- package/dist/packages/pill/index.js +5 -5
- package/dist/packages/pill/index.js.map +2 -2
- package/dist/packages/pill/locales/da/messages.mjs +1 -0
- package/dist/packages/pill/locales/en/messages.mjs +1 -0
- package/dist/packages/pill/locales/fi/messages.mjs +1 -0
- package/dist/packages/pill/locales/nb/messages.mjs +1 -0
- package/dist/packages/pill/locales/sv/messages.mjs +1 -0
- package/dist/packages/pill/pill.react.stories.d.ts +23 -0
- package/dist/packages/pill/pill.react.stories.js +22 -0
- package/dist/packages/pill/pill.stories.js +33 -0
- package/dist/packages/pill/pill.test.js +25 -0
- package/dist/packages/pill/react.d.ts +7 -0
- package/dist/packages/pill/react.js +17 -0
- package/dist/packages/pill/styles.js +2 -0
- package/dist/packages/select/index.d.ts +4 -29
- package/dist/packages/select/index.js +25 -18
- package/dist/packages/select/index.js.map +3 -3
- package/dist/packages/select/locales/da/messages.mjs +1 -0
- package/dist/packages/select/locales/en/messages.mjs +1 -0
- package/dist/packages/select/locales/fi/messages.mjs +1 -0
- package/dist/packages/select/locales/nb/messages.mjs +1 -0
- package/dist/packages/select/locales/sv/messages.mjs +1 -0
- package/dist/packages/select/react.d.ts +6 -2
- package/dist/packages/select/react.js +20 -2494
- package/dist/packages/select/select.react.stories.d.ts +18 -0
- package/dist/packages/select/select.react.stories.js +28 -0
- package/dist/packages/select/select.stories.d.ts +7 -0
- package/dist/packages/select/select.stories.js +100 -0
- package/dist/packages/select/select.test.js +31 -0
- package/dist/packages/select/styles.js +2 -0
- package/dist/packages/{switch/index.js → styles.js} +5 -18
- package/dist/packages/textfield/index.d.ts +12 -26
- package/dist/packages/textfield/index.js +86 -28
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/textfield/react.d.ts +11 -2
- package/dist/packages/textfield/react.js +21 -2490
- package/dist/packages/textfield/styles/w-textfield.styles.d.ts +1 -0
- package/dist/packages/textfield/styles/w-textfield.styles.js +55 -0
- package/dist/packages/textfield/styles.js +2 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +37 -0
- package/dist/packages/textfield/textfield.react.stories.js +88 -0
- package/dist/packages/textfield/textfield.stories.d.ts +1 -0
- package/dist/packages/textfield/textfield.stories.js +105 -0
- package/dist/packages/textfield/textfield.test.d.ts +1 -0
- package/dist/packages/textfield/textfield.test.js +68 -0
- package/dist/packages/toast/api.d.ts +4 -45
- package/dist/packages/toast/api.js +41 -0
- package/dist/packages/toast/index.d.ts +3 -3
- package/dist/packages/toast/index.js +2463 -24
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/locales/da/messages.mjs +1 -0
- package/dist/packages/toast/locales/en/messages.mjs +1 -0
- package/dist/packages/toast/locales/fi/messages.mjs +1 -0
- package/dist/packages/toast/locales/nb/messages.mjs +1 -0
- package/dist/packages/toast/locales/sv/messages.mjs +1 -0
- package/dist/packages/toast/styles.js +2 -0
- package/dist/packages/toast/toast-container.d.ts +12 -78
- package/dist/packages/{switch/react.js → toast/toast-container.js} +21 -38
- package/dist/packages/toast/toast-container.js.map +7 -0
- package/dist/packages/toast/toast.d.ts +16 -29
- package/dist/packages/{pagination/index.js → toast/toast.js} +21 -49
- package/dist/packages/toast/toast.js.map +7 -0
- package/dist/packages/toast/toast.stories.js +50 -0
- package/dist/packages/toast/types.d.ts +15 -0
- package/dist/packages/toast/types.js +1 -0
- package/dist/packages/utils/expand-transition.d.ts +3 -3
- package/dist/packages/utils/expand-transition.js +59 -0
- package/dist/packages/utils/index.js +37 -0
- package/dist/packages/utils/unstyled-heading.d.ts +2 -3
- package/dist/packages/utils/unstyled-heading.js +22 -0
- package/dist/packages/utils/window-exists.js +1 -0
- package/dist/setup-tests.js +1 -0
- package/dist/web-types.json +225 -510
- package/package.json +39 -32
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -7
- package/dist/index.js +0 -3386
- package/dist/index.js.map +0 -7
- package/dist/packages/affix/react.js.map +0 -7
- package/dist/packages/alert/react.js.map +0 -7
- package/dist/packages/badge/react.js.map +0 -7
- package/dist/packages/breadcrumbs/react.js.map +0 -7
- package/dist/packages/button/react.js.map +0 -7
- package/dist/packages/card/react.js.map +0 -7
- package/dist/packages/datepicker/DatePicker.test.d.ts +0 -1
- package/dist/packages/datepicker/datepicker.d.ts +0 -107
- package/dist/packages/datepicker/datepicker.stories.d.ts +0 -11
- package/dist/packages/datepicker/datepicker.test.d.ts +0 -2
- package/dist/packages/datepicker/index.d.ts +0 -1
- package/dist/packages/datepicker/index.js +0 -2785
- package/dist/packages/datepicker/index.js.map +0 -7
- package/dist/packages/datepicker/locales/da/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/en/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/fi/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/nb/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/sv/messages.d.mts +0 -1
- package/dist/packages/datepicker/react.d.ts +0 -2
- package/dist/packages/datepicker/react.js +0 -2805
- package/dist/packages/datepicker/react.js.map +0 -7
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +0 -1
- package/dist/packages/datepicker/utils.d.ts +0 -13
- package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +0 -10
- package/dist/packages/dead-toggle/index.d.ts +0 -21
- package/dist/packages/dead-toggle/index.js.map +0 -7
- package/dist/packages/dead-toggle/react.d.ts +0 -2
- package/dist/packages/dead-toggle/react.js.map +0 -7
- package/dist/packages/expandable/react.js.map +0 -7
- package/dist/packages/link/index.js.map +0 -7
- package/dist/packages/link/link.stories.d.ts +0 -20
- package/dist/packages/link/link.test.d.ts +0 -1
- package/dist/packages/link/react.d.ts +0 -2
- package/dist/packages/link/react.js +0 -2666
- package/dist/packages/link/react.js.map +0 -7
- package/dist/packages/modal/react.js.map +0 -7
- package/dist/packages/pageindicator/index.d.ts +0 -14
- package/dist/packages/pageindicator/index.js +0 -32
- package/dist/packages/pageindicator/index.js.map +0 -7
- package/dist/packages/pageindicator/pageindicator.stories.d.ts +0 -32
- package/dist/packages/pageindicator/react.d.ts +0 -2
- package/dist/packages/pageindicator/react.js +0 -52
- package/dist/packages/pageindicator/react.js.map +0 -7
- package/dist/packages/pagination/index.d.ts +0 -37
- package/dist/packages/pagination/index.js.map +0 -7
- package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
- package/dist/packages/pagination/pagination.stories.d.ts +0 -14
- package/dist/packages/pagination/pagination.test.d.ts +0 -1
- package/dist/packages/pagination/react.d.ts +0 -2
- package/dist/packages/pagination/react.js +0 -2514
- package/dist/packages/pagination/react.js.map +0 -7
- package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +0 -64
- package/dist/packages/rip-and-tear-checkbox/index.css +0 -2
- package/dist/packages/rip-and-tear-checkbox/index.css.map +0 -7
- package/dist/packages/rip-and-tear-checkbox/index.d.ts +0 -6
- package/dist/packages/rip-and-tear-checkbox/index.js +0 -36
- package/dist/packages/rip-and-tear-checkbox/index.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/base-element.d.ts +0 -46
- package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +0 -6
- package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +0 -103
- package/dist/packages/rip-and-tear-radio/index.css +0 -2
- package/dist/packages/rip-and-tear-radio/index.css.map +0 -7
- package/dist/packages/rip-and-tear-radio/index.d.ts +0 -8
- package/dist/packages/rip-and-tear-radio/index.js +0 -34
- package/dist/packages/rip-and-tear-radio/index.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/invalid.d.ts +0 -8
- package/dist/packages/rip-and-tear-radio/math.d.ts +0 -1
- package/dist/packages/rip-and-tear-radio/radio-group.d.ts +0 -72
- package/dist/packages/rip-and-tear-radio/radio.d.ts +0 -38
- package/dist/packages/rip-and-tear-radio/required-validator.d.ts +0 -11
- package/dist/packages/rip-and-tear-radio/slot.d.ts +0 -20
- package/dist/packages/rip-and-tear-radio/watch.d.ts +0 -26
- package/dist/packages/select/react.js.map +0 -7
- package/dist/packages/steps/index.d.ts +0 -43
- package/dist/packages/steps/index.js.map +0 -7
- package/dist/packages/steps/locales/da/messages.d.mts +0 -1
- package/dist/packages/steps/locales/en/messages.d.mts +0 -1
- package/dist/packages/steps/locales/fi/messages.d.mts +0 -1
- package/dist/packages/steps/locales/nb/messages.d.mts +0 -1
- package/dist/packages/steps/locales/sv/messages.d.mts +0 -1
- package/dist/packages/steps/react.d.ts +0 -3
- package/dist/packages/steps/react.js +0 -2485
- package/dist/packages/steps/react.js.map +0 -7
- package/dist/packages/steps/steps.stories.d.ts +0 -12
- package/dist/packages/switch/index.d.ts +0 -20
- package/dist/packages/switch/index.js.map +0 -7
- package/dist/packages/switch/react.d.ts +0 -2
- package/dist/packages/switch/react.js.map +0 -7
- package/dist/packages/switch/styles.d.ts +0 -1
- package/dist/packages/switch/switch.stories.d.ts +0 -9
- package/dist/packages/textfield/react.js.map +0 -7
- package/dist/vscode.css-custom-data.json +0 -6
- package/dist/vscode.html-custom-data.json +0 -418
- /package/dist/packages/{dead-toggle/dead-toggle.test.d.ts → attention/attention.test.d.ts} +0 -0
- /package/dist/packages/{pageindicator/style.d.ts → attention/layout-styles.d.ts} +0 -0
- /package/dist/packages/{pagination → attention}/styles.d.ts +0 -0
- /package/dist/packages/{steps → toast}/styles.d.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { expect, test } from 'vitest';
|
|
3
|
+
import { render } from 'vitest-browser-lit';
|
|
4
|
+
import './index.js';
|
|
5
|
+
test('renders the slotted label', async () => {
|
|
6
|
+
const component = html `<w-box>This is not a button</w-box>`;
|
|
7
|
+
const page = render(component);
|
|
8
|
+
await expect.element(page.getByText('This is not a button')).toBeVisible();
|
|
9
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.border-2{border-width:2px}.rounded-8{border-radius:8px}.rounded-l-0{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-0{border-top-right-radius:0;border-bottom-right-radius:0}.block{display:block}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-info-subtle{background-color:var(--w-s-color-background-info-subtle)}.s-border{border-color:var(--w-s-color-border)}.s-surface-sunken{background-color:var(--w-s-color-surface-sunken)}.-mx-16{margin-left:-1.6rem;margin-right:-1.6rem}.last-child\\:mb-0>:last-child{margin-bottom:0}.p-16{padding:1.6rem}.break-words{overflow-wrap:break-word}@media (min-width:480px){.sm\\:rounded-8{border-radius:8px}.sm\\:mx-0{margin-left:0;margin-right:0}}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
import { Breadcrumbs } from './react';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
render(args: Omit<React.HTMLAttributes<import(".").WarpBreadcrumbs>, "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "_children"> & {} & Partial<Omit<import(".").WarpBreadcrumbs, keyof HTMLElement>> & React.RefAttributes<import(".").WarpBreadcrumbs>): React.JSX.Element;
|
|
7
|
+
component: import("@lit/react").ReactWebComponent<import(".").WarpBreadcrumbs, {}>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
export type Story = StoryObj<typeof Breadcrumbs>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const WithLinks: Story;
|
|
13
|
+
export declare const WithSpanForCurrentPage: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Breadcrumbs } from './react';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Navigation/Breadcrumbs',
|
|
5
|
+
render(args) {
|
|
6
|
+
return (React.createElement(Breadcrumbs, { ...args },
|
|
7
|
+
React.createElement("a", { href: "#/home" }, "Home"),
|
|
8
|
+
React.createElement("a", { href: "#/category" }, "Category"),
|
|
9
|
+
React.createElement("a", { href: "#/subcategory" }, "Subcategory"),
|
|
10
|
+
React.createElement("span", { "aria-current": "page" }, "Current Page")));
|
|
11
|
+
},
|
|
12
|
+
component: Breadcrumbs,
|
|
13
|
+
};
|
|
14
|
+
export const Default = {
|
|
15
|
+
args: {
|
|
16
|
+
'aria-label': 'You are here',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const WithLinks = {
|
|
20
|
+
args: {
|
|
21
|
+
'aria-label': 'Navigation breadcrumb',
|
|
22
|
+
},
|
|
23
|
+
render(args) {
|
|
24
|
+
return (React.createElement(Breadcrumbs, { ...args },
|
|
25
|
+
React.createElement("a", { href: "#/eiendom" }, "Eiendom"),
|
|
26
|
+
React.createElement("a", { href: "#/bolig-til-salgs" }, "Bolig til salgs"),
|
|
27
|
+
React.createElement("a", { href: "#/oslo", "aria-current": "page" }, "Oslo")));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const WithSpanForCurrentPage = {
|
|
31
|
+
args: {
|
|
32
|
+
'aria-label': 'You are here',
|
|
33
|
+
},
|
|
34
|
+
render(args) {
|
|
35
|
+
return (React.createElement(Breadcrumbs, { ...args },
|
|
36
|
+
React.createElement("a", { href: "#/eiendom" }, "Eiendom"),
|
|
37
|
+
React.createElement("a", { href: "#/bolig-til-salgs" }, "Bolig til salgs"),
|
|
38
|
+
React.createElement("span", { "aria-current": "page" }, "Oslo")));
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { spread } from '@open-wc/lit-helpers';
|
|
2
|
+
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { prespread } from '../../.storybook/utilities.js';
|
|
5
|
+
import './index.js';
|
|
6
|
+
const { events, args, argTypes } = getStorybookHelpers('w-breadcrumbs');
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Navigation/Breadcrumbs',
|
|
9
|
+
render(args) {
|
|
10
|
+
return html `
|
|
11
|
+
<w-breadcrumbs ${spread(prespread(args))}>
|
|
12
|
+
<a href="#/home">Home</a>
|
|
13
|
+
<a href="#/category">Category</a>
|
|
14
|
+
<a href="#/subcategory">Subcategory</a>
|
|
15
|
+
<span aria-current="page">Current Page</span>
|
|
16
|
+
</w-breadcrumbs>
|
|
17
|
+
`;
|
|
18
|
+
},
|
|
19
|
+
args,
|
|
20
|
+
argTypes,
|
|
21
|
+
parameters: {
|
|
22
|
+
actions: {
|
|
23
|
+
handles: events,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
export const Default = {
|
|
29
|
+
args: {
|
|
30
|
+
'aria-label': 'You are here',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const WithLinks = {
|
|
34
|
+
args: {
|
|
35
|
+
'aria-label': 'Navigation breadcrumb',
|
|
36
|
+
},
|
|
37
|
+
render(args) {
|
|
38
|
+
return html `
|
|
39
|
+
<w-breadcrumbs ${spread(prespread(args))}>
|
|
40
|
+
<a href="#/eiendom">Eiendom</a>
|
|
41
|
+
<a href="#/bolig-til-salgs">Bolig til salgs</a>
|
|
42
|
+
<a href="#/oslo" aria-current="page">Oslo</a>
|
|
43
|
+
</w-breadcrumbs>
|
|
44
|
+
`;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
export const WithSpanForCurrentPage = {
|
|
48
|
+
args: {
|
|
49
|
+
'aria-label': 'You are here',
|
|
50
|
+
},
|
|
51
|
+
render(args) {
|
|
52
|
+
return html `
|
|
53
|
+
<w-breadcrumbs ${spread(prespread(args))}>
|
|
54
|
+
<a href="#/eiendom">Eiendom</a>
|
|
55
|
+
<a href="#/bolig-til-salgs">Bolig til salgs</a>
|
|
56
|
+
<span aria-current="page">Oslo</span>
|
|
57
|
+
</w-breadcrumbs>
|
|
58
|
+
`;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { expect, test } from 'vitest';
|
|
3
|
+
import { render } from 'vitest-browser-lit';
|
|
4
|
+
import './index.js';
|
|
5
|
+
test('renders a bread crumb', async () => {
|
|
6
|
+
const page = render(html ` <w-breadcrumb>
|
|
7
|
+
<a href="/foo">Foo</a>
|
|
8
|
+
<a href="/bar">Bar</a>
|
|
9
|
+
</w-breadcrumb>`);
|
|
10
|
+
await expect.element(page.getByText('Foo')).toBeVisible();
|
|
11
|
+
await expect.element(page.getByText('Bar')).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
test('renders an aria-label if set', async () => {
|
|
14
|
+
const page = render(html ` <w-breadcrumb aria-label="You are here"> </w-breadcrumb>`);
|
|
15
|
+
await expect.element(page.getByLabelText('You are here', { hasText: 'w-breadcrumb' })).toBeDefined();
|
|
16
|
+
});
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
export declare const ccBreadcrumbs: {
|
|
3
|
-
wrapper: string;
|
|
4
|
-
text: string;
|
|
5
|
-
link: string;
|
|
6
|
-
separator: string;
|
|
7
|
-
a11y: string;
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* Breadcrumbs show the navigation structure for the current location.
|
|
11
4
|
*
|
|
@@ -21,8 +14,3 @@ declare class WarpBreadcrumbs extends LitElement {
|
|
|
21
14
|
render(): TemplateResult<1>;
|
|
22
15
|
}
|
|
23
16
|
export { WarpBreadcrumbs };
|
|
24
|
-
declare global {
|
|
25
|
-
interface HTMLElementTagNameMap {
|
|
26
|
-
'w-breadcrumbs': WarpBreadcrumbs;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var ce=Object.create;var E=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ke(o){return xe.get(o)||o}var ye=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function U(o,e=!1){return o.replace(ye,function(r,t,a,s,i,n,l,d,g){if(t!==void 0)return"\\";if(a!==void 0)return me(a);if(s!==void 0)return we(s);if(i!==void 0)return X(i,n);if(l!==void 0)return X(l);if(d==="0")return"\0";if(d!==void 0)return fe(d,!e);if(g!==void 0)return ke(g);throw new SyntaxError(c.errorMessages.get(c.ErrorType.EndOfString))})}b.unraw=U;b.default=U});
|
|
1
|
+
var ce=Object.create;var E=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var A=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ge=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of de(e))!pe.call(o,a)&&a!==r&&E(o,a,{get:()=>e[a],enumerable:!(t=P(e,a))||t.enumerable});return o};var ue=(o,e,r)=>(r=o!=null?ce(be(o)):{},ge(e||!o||!o.__esModule?E(r,"default",{value:o,enumerable:!0}):r,o));var F=(o,e,r,t)=>{for(var a=t>1?void 0:t?P(e,r):e,s=o.length-1,i;s>=0;s--)(i=o[s])&&(a=(t?i(e,r,a):i(a))||a);return t&&a&&E(e,r,a),a};var $=A(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.errorMessages=h.ErrorType=void 0;var v;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(v=h.ErrorType||(h.ErrorType={}));h.errorMessages=new Map([[v.MalformedUnicode,"malformed Unicode character escape sequence"],[v.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[v.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[v.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[v.EndOfString,"malformed escape sequence at end of string"]])});var Z=A(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.unraw=b.errorMessages=b.ErrorType=void 0;var c=$();Object.defineProperty(b,"ErrorType",{enumerable:!0,get:function(){return c.ErrorType}});Object.defineProperty(b,"errorMessages",{enumerable:!0,get:function(){return c.errorMessages}});function he(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function _(o,e,r){let t=he(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(c.errorMessages.get(e));return t}function me(o){let e=_(o,c.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function X(o,e){let r=_(o,c.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=_(e,c.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function ve(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function we(o){if(!ve(o))throw new SyntaxError(c.errorMessages.get(c.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=_(e,c.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(c.errorMessages.get(c.ErrorType.CodePointLimit)):t}}function fe(o,e=!1){if(e)throw new SyntaxError(c.errorMessages.get(c.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var xe=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ke(o){return xe.get(o)||o}var ye=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function U(o,e=!1){return o.replace(ye,function(r,t,a,s,i,n,l,d,g){if(t!==void 0)return"\\";if(a!==void 0)return me(a);if(s!==void 0)return we(s);if(i!==void 0)return X(i,n);if(l!==void 0)return X(l);if(d==="0")return"\0";if(d!==void 0)return fe(d,!e);if(g!==void 0)return ke(g);throw new SyntaxError(c.errorMessages.get(c.ErrorType.EndOfString))})}b.unraw=U;b.default=U});var q=ue(Z(),1);var p=o=>typeof o=="string",_e=o=>typeof o=="function",H=new Map,J="en";function Y(o){return[...Array.isArray(o)?o:[o],J]}function D(o,e,r){let t=Y(o);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return z(()=>M("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(p(e)?new Date(e):e)}function ze(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return D(o,e,t)}function O(o,e,r){let t=Y(o);return z(()=>M("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function R(o,e,r,{offset:t=0,...a}){var n,l;let s=Y(o),i=e?z(()=>M("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):z(()=>M("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(l=(n=a[r])!=null?n:a[i.select(r-t)])!=null?l:a.other}function z(o,e){let r=o(),t=H.get(r);return t||(t=e(),H.set(r,t)),t}function M(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var G=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,V="%__lingui_octothorpe__%",Me=(o,e,r={})=>{let t=e||o,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let l=Object.keys(r).length?a("number"):void 0,d=O(t,i,l);return n.replace(new RegExp(V,"g"),d)};return{plural:(i,n)=>{let{offset:l=0}=n,d=R(t,!1,i,n);return s(i-l,d)},selectordinal:(i,n)=>{let{offset:l=0}=n,d=R(t,!0,i,n);return s(i-l,d)},select:Le,number:(i,n)=>O(t,i,a(n)||{style:n}),date:(i,n)=>D(t,i,a(n)||n),time:(i,n)=>ze(t,i,a(n)||n)}},Le=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function Ce(o,e,r){return(t={},a)=>{let s=Me(e,r,a),i=(l,d=!1)=>Array.isArray(l)?l.reduce((g,k)=>{if(k==="#"&&d)return g+V;if(p(k))return g+k;let[T,u,I]=k,L={};u==="plural"||u==="selectordinal"||u==="select"?Object.entries(I).forEach(([C,le])=>{L[C]=i(le,u==="plural"||u==="selectordinal")}):L=I;let y;if(u){let C=s[u];y=C(t[T],L)}else y=t[T];return y==null?g:g+y},""):l,n=i(o);return p(n)&&G.test(n)?(0,q.unraw)(n):p(n)?n:n?String(n):""}}var Ee=Object.defineProperty,Oe=(o,e,r)=>e in o?Ee(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Se=(o,e,r)=>(Oe(o,typeof e!="symbol"?e+"":e,r),r),S=class{constructor(){Se(this,"_events",{})}on(e,r){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Ne=Object.defineProperty,Ye=(o,e,r)=>e in o?Ne(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,m=(o,e,r)=>(Ye(o,typeof e!="symbol"?e+"":e,r),r),N=class extends S{constructor(e){var r;super(),m(this,"_locale",""),m(this,"_locales"),m(this,"_localeData",{}),m(this,"_messages",{}),m(this,"_missing"),m(this,"_messageCompiler"),m(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:J,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let t=this._localeData[e];t?Object.assign(t,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;e||(e=""),p(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return _e(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return p(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
4
|
> ${l}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),p(l)&&G.test(l)?JSON.parse(`"${l}"`):p(l)?l:Ce(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return
|
|
10
|
+
`)),p(l)&&G.test(l)?JSON.parse(`"${l}"`):p(l)?l:Ce(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return D(this._locales||this._locale,e,r)}number(e,r){return O(this._locales||this._locale,e,r)}};function De(o={}){return new N(o)}var f=De();function K(o,e){return o.flatMap(r=>[r,e]).slice(0,-1)}import{html as j,LitElement as Ae}from"lit";import{property as Fe}from"lit/decorators.js";var je=["en","nb","fi","da","sv"],Q="en",B=o=>je.find(e=>o===e||o.toLowerCase().includes(e))||Q;function Te(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return B(o)}try{let o=document.documentElement.lang;return B(o)}catch(o){return console.warn("could not detect locale, falling back to source locale",o),Q}}var Ie=(o,e,r,t,a,s)=>o==="nb"?r:o==="fi"?t:o==="da"?a:o==="sv"?s:e,W=(o,e,r,t,a)=>{let s=Te(),i=Ie(s,o,e,r,t,a);f.load(s,i),f.activate(s)};import{css as ee}from"lit";var re=ee`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -280,7 +280,7 @@ Please compile your catalog first.
|
|
|
280
280
|
svg {
|
|
281
281
|
pointer-events: none;
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`,Ke=ee`*, :before, :after {
|
|
284
284
|
--w-rotate: 0;
|
|
285
285
|
--w-rotate-x: 0;
|
|
286
286
|
--w-rotate-y: 0;
|
|
@@ -2446,10 +2446,10 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;var oe=JSON.parse('{"breadcrumbs.ariaLabel":["Du er her"]}');var te=JSON.parse('{"breadcrumbs.ariaLabel":["You are here"]}');var ae=JSON.parse('{"breadcrumbs.ariaLabel":["Olet t\xE4ss\xE4"]}');var ie=JSON.parse('{"breadcrumbs.ariaLabel":["Her er du"]}');var ne=JSON.parse('{"breadcrumbs.ariaLabel":["Du \xE4r h\xE4r"]}');import{css as Pe}from"lit";var se=Pe`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.flex{display:flex}.static{position:static}.s-text{color:var(--w-s-color-text)}.s-text-link{color:var(--w-s-color-text-link)}.s-icon{color:var(--w-s-color-icon)}.space-x-8>:not([hidden])~:not([hidden]){--w-space-x-reverse:0;margin-left:calc(.8rem*calc(1 - var(--w-space-x-reverse)));margin-right:calc(.8rem*var(--w-space-x-reverse))}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.select-none{-webkit-user-select:none;user-select:none}`;var w={wrapper:"flex space-x-8",text:"s-text",link:"s-text-link",separator:"select-none s-icon",a11y:"sr-only"},$e=j`<span class=${w.separator}>/</span>`,x=class extends
|
|
2449
|
+
`;var oe=JSON.parse('{"breadcrumbs.ariaLabel":["Du er her"]}');var te=JSON.parse('{"breadcrumbs.ariaLabel":["You are here"]}');var ae=JSON.parse('{"breadcrumbs.ariaLabel":["Olet t\xE4ss\xE4"]}');var ie=JSON.parse('{"breadcrumbs.ariaLabel":["Her er du"]}');var ne=JSON.parse('{"breadcrumbs.ariaLabel":["Du \xE4r h\xE4r"]}');import{css as Pe}from"lit";var se=Pe`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.flex{display:flex}.static{position:static}.s-text{color:var(--w-s-color-text)}.s-text-link{color:var(--w-s-color-text-link)}.s-icon{color:var(--w-s-color-icon)}.space-x-8>:not([hidden])~:not([hidden]){--w-space-x-reverse:0;margin-left:calc(.8rem*calc(1 - var(--w-space-x-reverse)));margin-right:calc(.8rem*var(--w-space-x-reverse))}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.select-none{-webkit-user-select:none;user-select:none}`;var w={wrapper:"flex space-x-8",text:"s-text",link:"s-text-link",separator:"select-none s-icon",a11y:"sr-only"},$e=j`<span class=${w.separator}>/</span>`,x=class extends Ae{constructor(){super(),W(te,ie,ae,oe,ne),this.ariaLabel=f._({id:"breadcrumbs.ariaLabel",message:"You are here",comment:"Default screen reader message for the breadcrumb component"})}connectedCallback(){super.connectedCallback();let r=Array.from(this.children).flat(Number.POSITIVE_INFINITY).filter(t=>t).map((t,a)=>{if(typeof t=="string"){let s=a===this.children.length-1;return j`<span class=${w.text} aria-current=${s?"page":void 0}>${t}</span>`}return t.classList.add(t.tagName==="A"?w.link:w.text),t});this._children=K(r,$e)}render(){return j`
|
|
2450
2450
|
<nav aria-labelledby="breadCrumbLabel">
|
|
2451
2451
|
<h2 id="breadCrumbLabel" class=${w.a11y}>${this.ariaLabel}</h2>
|
|
2452
2452
|
<div class=${w.wrapper}>${this._children}</div>
|
|
2453
2453
|
</nav>
|
|
2454
|
-
`}};x.styles=[re,se],
|
|
2454
|
+
`}};x.styles=[re,se],F([Fe({attribute:"aria-label",type:String})],x.prototype,"ariaLabel",2);customElements.get("w-breadcrumbs")||customElements.define("w-breadcrumbs",x);export{x as WarpBreadcrumbs};
|
|
2455
2455
|
//# sourceMappingURL=index.js.map
|