@vielzeug/refine 26.10.7 → 26.10.10
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 +6 -0
- package/dist/accordion-item.cjs +2 -2
- package/dist/accordion-item.cjs.map +1 -1
- package/dist/accordion-item.js +6 -6
- package/dist/accordion-item.js.map +1 -1
- package/dist/accordion.cjs +2 -2
- package/dist/accordion.cjs.map +1 -1
- package/dist/accordion.js +2 -2
- package/dist/accordion.js.map +1 -1
- package/dist/alert.cjs +2 -2
- package/dist/alert.cjs.map +1 -1
- package/dist/alert.js +2 -2
- package/dist/alert.js.map +1 -1
- package/dist/avatar.cjs +3 -3
- package/dist/avatar.cjs.map +1 -1
- package/dist/avatar.js +2 -2
- package/dist/avatar.js.map +1 -1
- package/dist/badge.cjs +2 -2
- package/dist/badge.cjs.map +1 -1
- package/dist/badge.js +2 -2
- package/dist/badge.js.map +1 -1
- package/dist/box.cjs +2 -2
- package/dist/box.cjs.map +1 -1
- package/dist/box.js +2 -2
- package/dist/box.js.map +1 -1
- package/dist/button-group.cjs +2 -2
- package/dist/button-group.cjs.map +1 -1
- package/dist/button-group.js +2 -2
- package/dist/button-group.js.map +1 -1
- package/dist/button.cjs +9 -9
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +8 -8
- package/dist/button.js.map +1 -1
- package/dist/card.cjs +2 -2
- package/dist/card.cjs.map +1 -1
- package/dist/card.js +2 -2
- package/dist/card.js.map +1 -1
- package/dist/carousel.cjs +6 -6
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +6 -6
- package/dist/carousel.js.map +1 -1
- package/dist/chat-message.cjs +4 -4
- package/dist/chat-message.cjs.map +1 -1
- package/dist/chat-message.js +4 -4
- package/dist/chat-message.js.map +1 -1
- package/dist/checkbox-group.cjs +1 -1
- package/dist/checkbox-group.cjs.map +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/chip.cjs +8 -8
- package/dist/chip.cjs.map +1 -1
- package/dist/chip.js +8 -8
- package/dist/chip.js.map +1 -1
- package/dist/combobox.cjs +8 -8
- package/dist/combobox.cjs.map +1 -1
- package/dist/combobox.js +11 -11
- package/dist/combobox.js.map +1 -1
- package/dist/content/avatar/avatar.d.ts +2 -1
- package/dist/content/avatar/avatar.d.ts.map +1 -1
- package/dist/content/card/card.d.ts +6 -3
- package/dist/content/card/card.d.ts.map +1 -1
- package/dist/content/carousel/carousel.d.ts +5 -3
- package/dist/content/carousel/carousel.d.ts.map +1 -1
- package/dist/content/chat-message/chat-message.d.ts +2 -1
- package/dist/content/chat-message/chat-message.d.ts.map +1 -1
- package/dist/content/copy-command/copy-command.d.ts +1 -1
- package/dist/content/copy-command/copy-command.d.ts.map +1 -1
- package/dist/content/keyboard-key/keyboard-key.d.ts +2 -1
- package/dist/content/keyboard-key/keyboard-key.d.ts.map +1 -1
- package/dist/content/list/list.d.ts +2 -1
- package/dist/content/list/list.d.ts.map +1 -1
- package/dist/content/marquee/marquee.d.ts +3 -2
- package/dist/content/marquee/marquee.d.ts.map +1 -1
- package/dist/content/pagination/pagination.d.ts +1 -1
- package/dist/content/pagination/pagination.d.ts.map +1 -1
- package/dist/content/qr-code/qr-code.d.ts +0 -41
- package/dist/content/qr-code/qr-code.d.ts.map +1 -1
- package/dist/content/separator/separator.d.ts +1 -1
- package/dist/content/separator/separator.d.ts.map +1 -1
- package/dist/content/stepper/step.d.ts +1 -1
- package/dist/content/stepper/step.d.ts.map +1 -1
- package/dist/content/table/table.d.ts +2 -1
- package/dist/content/table/table.d.ts.map +1 -1
- package/dist/content/text/text.d.ts +13 -6
- package/dist/content/text/text.d.ts.map +1 -1
- package/dist/cookie-banner.cjs +1 -1
- package/dist/cookie-banner.cjs.map +1 -1
- package/dist/cookie-banner.js +1 -1
- package/dist/cookie-banner.js.map +1 -1
- package/dist/copy-command.cjs +6 -6
- package/dist/copy-command.cjs.map +1 -1
- package/dist/copy-command.js +7 -7
- package/dist/copy-command.js.map +1 -1
- package/dist/core/checkable.cjs +1 -1
- package/dist/core/checkable.cjs.map +1 -1
- package/dist/core/checkable.d.ts +6 -7
- package/dist/core/checkable.d.ts.map +1 -1
- package/dist/core/checkable.js +1 -1
- package/dist/core/checkable.js.map +1 -1
- package/dist/core/choice-field.cjs +1 -1
- package/dist/core/choice-field.cjs.map +1 -1
- package/dist/core/choice-field.d.ts +6 -6
- package/dist/core/choice-field.d.ts.map +1 -1
- package/dist/core/choice-field.js +1 -1
- package/dist/core/choice-field.js.map +1 -1
- package/dist/core/text-field.cjs +1 -1
- package/dist/core/text-field.cjs.map +1 -1
- package/dist/core/text-field.d.ts +8 -8
- package/dist/core/text-field.d.ts.map +1 -1
- package/dist/core/text-field.js +1 -1
- package/dist/core/text-field.js.map +1 -1
- package/dist/counter.cjs +2 -2
- package/dist/counter.cjs.map +1 -1
- package/dist/counter.js +2 -2
- package/dist/counter.js.map +1 -1
- package/dist/custom-elements.json +886 -749
- package/dist/datagrid.cjs +47 -47
- package/dist/datagrid.cjs.map +1 -1
- package/dist/datagrid.js +51 -51
- package/dist/datagrid.js.map +1 -1
- package/dist/date-picker.cjs +9 -9
- package/dist/date-picker.cjs.map +1 -1
- package/dist/date-picker.js +11 -11
- package/dist/date-picker.js.map +1 -1
- package/dist/dialog.cjs +3 -3
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.js +3 -3
- package/dist/dialog.js.map +1 -1
- package/dist/disclosure/accordion/accordion.d.ts +4 -2
- package/dist/disclosure/accordion/accordion.d.ts.map +1 -1
- package/dist/disclosure/accordion-item/accordion-item.d.ts +1 -1
- package/dist/disclosure/accordion-item/accordion-item.d.ts.map +1 -1
- package/dist/disclosure/tab-item/tab-item.d.ts +1 -1
- package/dist/disclosure/tab-item/tab-item.d.ts.map +1 -1
- package/dist/disclosure/tabs/tabs.d.ts +1 -1
- package/dist/disclosure/tabs/tabs.d.ts.map +1 -1
- package/dist/drawer.cjs +4 -4
- package/dist/drawer.cjs.map +1 -1
- package/dist/drawer.js +2 -2
- package/dist/drawer.js.map +1 -1
- package/dist/feedback/alert/alert.d.ts +2 -1
- package/dist/feedback/alert/alert.d.ts.map +1 -1
- package/dist/feedback/badge/badge.d.ts +7 -4
- package/dist/feedback/badge/badge.d.ts.map +1 -1
- package/dist/feedback/chip/chip.d.ts +7 -5
- package/dist/feedback/chip/chip.d.ts.map +1 -1
- package/dist/grid-item.cjs +2 -2
- package/dist/grid-item.cjs.map +1 -1
- package/dist/grid-item.js +2 -2
- package/dist/grid-item.js.map +1 -1
- package/dist/grid.cjs +2 -2
- package/dist/grid.cjs.map +1 -1
- package/dist/grid.js +2 -2
- package/dist/grid.js.map +1 -1
- package/dist/input.cjs +7 -7
- package/dist/input.cjs.map +1 -1
- package/dist/input.js +8 -8
- package/dist/input.js.map +1 -1
- package/dist/inputs/button/button.d.ts +3 -2
- package/dist/inputs/button/button.d.ts.map +1 -1
- package/dist/inputs/button-group/button-group.d.ts +1 -37
- package/dist/inputs/button-group/button-group.d.ts.map +1 -1
- package/dist/inputs/combobox/combobox.types.d.ts +2 -2
- package/dist/inputs/combobox/combobox.types.d.ts.map +1 -1
- package/dist/inputs/counter/counter.d.ts +3 -2
- package/dist/inputs/counter/counter.d.ts.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.cjs +1 -1
- package/dist/inputs/datagrid/datagrid-model.cjs.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.d.ts +2 -1
- package/dist/inputs/datagrid/datagrid-model.d.ts.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.js +1 -1
- package/dist/inputs/datagrid/datagrid-model.js.map +1 -1
- package/dist/inputs/datagrid/datagrid.d.ts +4 -2
- package/dist/inputs/datagrid/datagrid.d.ts.map +1 -1
- package/dist/inputs/date-picker/date-picker.d.ts +3 -2
- package/dist/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/inputs/input/input.d.ts +5 -3
- package/dist/inputs/input/input.d.ts.map +1 -1
- package/dist/inputs/message-composer/message-composer.d.ts +3 -2
- package/dist/inputs/message-composer/message-composer.d.ts.map +1 -1
- package/dist/inputs/number-input/number-input.d.ts +1 -1
- package/dist/inputs/number-input/number-input.d.ts.map +1 -1
- package/dist/inputs/otp-input/otp-input.d.ts +3 -2
- package/dist/inputs/otp-input/otp-input.d.ts.map +1 -1
- package/dist/inputs/query-bar/query-bar.d.ts.map +1 -1
- package/dist/inputs/select/select.d.ts +2 -2
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/inputs/textarea/textarea.d.ts +4 -3
- package/dist/inputs/textarea/textarea.d.ts.map +1 -1
- package/dist/inputs/time-picker/time-picker.d.ts +2 -2
- package/dist/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/keyboard-key.cjs +3 -3
- package/dist/keyboard-key.cjs.map +1 -1
- package/dist/keyboard-key.js +3 -3
- package/dist/keyboard-key.js.map +1 -1
- package/dist/layout/box/box.d.ts +6 -3
- package/dist/layout/box/box.d.ts.map +1 -1
- package/dist/layout/grid/grid.d.ts +11 -6
- package/dist/layout/grid/grid.d.ts.map +1 -1
- package/dist/layout/grid-item/grid-item.d.ts +8 -4
- package/dist/layout/grid-item/grid-item.d.ts.map +1 -1
- package/dist/layout/navbar/navbar.d.ts +4 -2
- package/dist/layout/navbar/navbar.d.ts.map +1 -1
- package/dist/layout/sidebar/sidebar.d.ts +2 -1
- package/dist/layout/sidebar/sidebar.d.ts.map +1 -1
- package/dist/list-item.cjs +1 -1
- package/dist/list-item.cjs.map +1 -1
- package/dist/list-item.js +1 -1
- package/dist/list-item.js.map +1 -1
- package/dist/list.cjs +2 -2
- package/dist/list.cjs.map +1 -1
- package/dist/list.js +2 -2
- package/dist/list.js.map +1 -1
- package/dist/marquee.cjs +3 -3
- package/dist/marquee.cjs.map +1 -1
- package/dist/marquee.js +3 -3
- package/dist/marquee.js.map +1 -1
- package/dist/menu.cjs +3 -3
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.js +3 -3
- package/dist/menu.js.map +1 -1
- package/dist/message-composer.cjs +10 -10
- package/dist/message-composer.cjs.map +1 -1
- package/dist/message-composer.js +7 -7
- package/dist/message-composer.js.map +1 -1
- package/dist/navbar.cjs +10 -10
- package/dist/navbar.cjs.map +1 -1
- package/dist/navbar.js +13 -13
- package/dist/navbar.js.map +1 -1
- package/dist/number-input.cjs +3 -3
- package/dist/number-input.cjs.map +1 -1
- package/dist/number-input.js +4 -4
- package/dist/number-input.js.map +1 -1
- package/dist/otp-input.cjs +4 -4
- package/dist/otp-input.cjs.map +1 -1
- package/dist/otp-input.js +4 -4
- package/dist/otp-input.js.map +1 -1
- package/dist/overlay/dialog/dialog.d.ts +7 -4
- package/dist/overlay/dialog/dialog.d.ts.map +1 -1
- package/dist/overlay/drawer/drawer.d.ts +4 -2
- package/dist/overlay/drawer/drawer.d.ts.map +1 -1
- package/dist/overlay/menu/menu.d.ts +2 -1
- package/dist/overlay/menu/menu.d.ts.map +1 -1
- package/dist/pagination.cjs +9 -9
- package/dist/pagination.cjs.map +1 -1
- package/dist/pagination.js +9 -9
- package/dist/pagination.js.map +1 -1
- package/dist/qr-code.cjs +2 -2
- package/dist/qr-code.cjs.map +1 -1
- package/dist/qr-code.js +2 -2
- package/dist/qr-code.js.map +1 -1
- package/dist/query-bar.cjs +7 -7
- package/dist/query-bar.cjs.map +1 -1
- package/dist/query-bar.js +8 -8
- package/dist/query-bar.js.map +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/refine.cjs +123 -123
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +123 -123
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +124 -124
- package/dist/refine.js.map +1 -1
- package/dist/select.cjs +13 -13
- package/dist/select.cjs.map +1 -1
- package/dist/select.js +15 -15
- package/dist/select.js.map +1 -1
- package/dist/separator.cjs +4 -4
- package/dist/separator.cjs.map +1 -1
- package/dist/separator.js +4 -4
- package/dist/separator.js.map +1 -1
- package/dist/shared/prop-bundles.cjs +1 -1
- package/dist/shared/prop-bundles.cjs.map +1 -1
- package/dist/shared/prop-bundles.d.ts +7 -8
- package/dist/shared/prop-bundles.d.ts.map +1 -1
- package/dist/shared/prop-bundles.js +1 -1
- package/dist/shared/prop-bundles.js.map +1 -1
- package/dist/shared/types.cjs +2 -0
- package/dist/shared/types.cjs.map +1 -0
- package/dist/shared/types.d.ts +27 -9
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +2 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/sidebar.cjs +7 -7
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js +4 -4
- package/dist/sidebar.js.map +1 -1
- package/dist/step.cjs +10 -10
- package/dist/step.cjs.map +1 -1
- package/dist/step.js +10 -10
- package/dist/step.js.map +1 -1
- package/dist/tab-item.cjs +4 -4
- package/dist/tab-item.cjs.map +1 -1
- package/dist/tab-item.js +5 -5
- package/dist/tab-item.js.map +1 -1
- package/dist/table.cjs +2 -2
- package/dist/table.cjs.map +1 -1
- package/dist/table.js +2 -2
- package/dist/table.js.map +1 -1
- package/dist/tabs.cjs +2 -2
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.js +4 -4
- package/dist/tabs.js.map +1 -1
- package/dist/text.cjs +2 -2
- package/dist/text.cjs.map +1 -1
- package/dist/text.js +2 -2
- package/dist/text.js.map +1 -1
- package/dist/textarea.cjs +7 -7
- package/dist/textarea.cjs.map +1 -1
- package/dist/textarea.js +7 -7
- package/dist/textarea.js.map +1 -1
- package/dist/time-picker.cjs +7 -7
- package/dist/time-picker.cjs.map +1 -1
- package/dist/time-picker.js +7 -7
- package/dist/time-picker.js.map +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.cjs.map +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.js.map +1 -1
- package/package.json +15 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/content/avatar/avatar.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/content/avatar/avatar.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,eAAO,MAAM,eAAe,gDAAiD,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAS5D,kCAAkC;AAClC,MAAM,MAAM,cAAc,GAAG;IAC3B,4FAA4F;IAC5F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,OAAO,CAAC,EAAE,WAAW,GAAG,EAAE,CAAC;IAC3B,qBAAqB;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,EAAG,YAAqB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ElevationLevel, type PaddingSize, type ThemeColor } from '../../types';
|
|
2
|
+
declare const CARD_ORIENTATIONS: readonly ["horizontal"];
|
|
3
|
+
declare const CARD_VARIANTS: readonly ["solid", "flat", "frost"];
|
|
2
4
|
/** Card component properties */
|
|
3
5
|
export type OreCardEvents = {
|
|
4
6
|
activate: {
|
|
@@ -18,11 +20,11 @@ export type OreCardProps = {
|
|
|
18
20
|
/** Show a loading progress bar */
|
|
19
21
|
loading?: boolean;
|
|
20
22
|
/** Card orientation */
|
|
21
|
-
orientation?:
|
|
23
|
+
orientation?: (typeof CARD_ORIENTATIONS)[number];
|
|
22
24
|
/** Internal padding size */
|
|
23
25
|
padding?: PaddingSize;
|
|
24
26
|
/** Visual style variant */
|
|
25
|
-
variant?:
|
|
27
|
+
variant?: (typeof CARD_VARIANTS)[number];
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
28
30
|
* A versatile card container with semantic slots for media, header, body, footer, and actions.
|
|
@@ -71,4 +73,5 @@ export type OreCardProps = {
|
|
|
71
73
|
* ```
|
|
72
74
|
*/
|
|
73
75
|
export declare const CARD_TAG: "ore-card";
|
|
76
|
+
export {};
|
|
74
77
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/content/card/card.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/content/card/card.ts"],"names":[],"mappings":"AAYA,OAAO,EAAoB,KAAK,cAAc,EAAiB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtH,QAAA,MAAM,iBAAiB,yBAA0B,CAAC;AAClD,QAAA,MAAM,aAAa,qCAAsC,CAAC;AAqB1D,gCAAgC;AAEhC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE;QAAE,aAAa,EAAE,UAAU,GAAG,aAAa,CAAC;QAAC,OAAO,EAAE,SAAS,GAAG,UAAU,CAAA;KAAE,CAAC;CAC1F,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,kBAAkB;IAClB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uBAAuB;IACvB,WAAW,CAAC,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;IACjD,4BAA4B;IAC5B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ThemeColor } from '../../types';
|
|
2
2
|
import './carousel-slide';
|
|
3
3
|
export { ICON_TAG } from '../../content/icon/icon';
|
|
4
4
|
export { PROGRESS_TAG } from '../../feedback/progress/progress';
|
|
5
5
|
export { CAROUSEL_SLIDE_TAG } from './carousel-slide';
|
|
6
|
-
export
|
|
7
|
-
export type
|
|
6
|
+
export declare const CAROUSEL_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
7
|
+
export type CarouselOrientation = (typeof CAROUSEL_ORIENTATIONS)[number];
|
|
8
|
+
export declare const CAROUSEL_VARIANTS: readonly ["default", "fade", "filmstrip", "gallery"];
|
|
9
|
+
export type CarouselVariant = (typeof CAROUSEL_VARIANTS)[number];
|
|
8
10
|
export type OreCarouselEvents = {
|
|
9
11
|
/** Fired when the active slide changes. */
|
|
10
12
|
change: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/content/carousel/carousel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/content/carousel/carousel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,qBAAqB,qCAAsC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,eAAO,MAAM,iBAAiB,sDAAuD,CAAC;AACtF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2CAA2C;IAC3C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,6DAA6D;IAC7D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,YAAY,EAAG,cAAuB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ICON_TAG } from '../icon/icon';
|
|
2
2
|
export type ChatMessageSender = 'assistant' | 'system' | 'user';
|
|
3
|
-
export
|
|
3
|
+
export declare const CHAT_MESSAGE_STATUSES: readonly ["error", "sending", "sent"];
|
|
4
|
+
export type ChatMessageStatus = (typeof CHAT_MESSAGE_STATUSES)[number];
|
|
4
5
|
/** Events emitted by the chat-message component */
|
|
5
6
|
export type OreChatMessageEvents = {
|
|
6
7
|
/** Fired when the retry action is activated on a `status="error"` message */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../src/content/chat-message/chat-message.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../src/content/chat-message/chat-message.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChE,eAAO,MAAM,qBAAqB,uCAAwC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAQvE,mDAAmD;AACnD,MAAM,MAAM,oBAAoB,GAAG;IACjC,6EAA6E;IAC7E,KAAK,EAAE;QAAE,aAAa,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC;CAClC,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,0GAA0G;IAC1G,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-command.d.ts","sourceRoot":"","sources":["../../../src/content/copy-command/copy-command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"copy-command.d.ts","sourceRoot":"","sources":["../../../src/content/copy-command/copy-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,aAAa,EAAiB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAMnG,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,yBAAyB;IACzB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,qBAAqB;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;CACzC,CAAC;AAEF,oCAAoC;AACpC,MAAM,MAAM,oBAAoB,GAAG;IACjC,uEAAuE;IACvE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-key.d.ts","sourceRoot":"","sources":["../../../src/content/keyboard-key/keyboard-key.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"keyboard-key.d.ts","sourceRoot":"","sources":["../../../src/content/keyboard-key/keyboard-key.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,uBAAwB,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAG,uBAAgC,CAAC;AAatE,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Readable } from '@vielzeug/ripple';
|
|
2
2
|
import type { ComponentSize } from '../../types';
|
|
3
3
|
/** Visual variant for `ore-list`. */
|
|
4
|
-
export
|
|
4
|
+
export declare const LIST_VARIANTS: readonly ["bordered", "plain", "separated"];
|
|
5
|
+
export type ListVariant = (typeof LIST_VARIANTS)[number];
|
|
5
6
|
/** Context provided by `ore-list` to its `ore-list-item` children. */
|
|
6
7
|
export type ListContext = {
|
|
7
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/content/list/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,QAAQ,EAAiB,MAAM,kBAAkB,CAAC;AAI1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,qCAAqC;AACrC,MAAM,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/content/list/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,QAAQ,EAAiB,MAAM,kBAAkB,CAAC;AAI1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,qCAAqC;AACrC,eAAO,MAAM,aAAa,6CAA8C,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,sEAAsE;AACtE,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C;;;;;OAKG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5C,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9B;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACrC,CAAC;AACF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,mDAA4C,CAAC;AAElE,2CAA2C;AAC3C,MAAM,MAAM,aAAa,GAAG;IAC1B,+EAA+E;IAC/E,MAAM,EAAE;QAAE,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;CAClC,CAAC;AAEF,gCAAgC;AAChC,MAAM,MAAM,YAAY,GAAG;IACzB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0IAA0I;IAC1I,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ThemeColor } from '../../types';
|
|
2
2
|
export { BUTTON_TAG } from '../../inputs/button/button';
|
|
3
3
|
export { ICON_TAG } from '../icon/icon';
|
|
4
|
-
export
|
|
4
|
+
export declare const MARQUEE_DIRECTIONS: readonly ["left", "right"];
|
|
5
|
+
export type MarqueeDirection = (typeof MARQUEE_DIRECTIONS)[number];
|
|
5
6
|
export type OreMarqueeProps = {
|
|
6
7
|
/** Theme color for the navigation controls. */
|
|
7
8
|
color?: ThemeColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marquee.d.ts","sourceRoot":"","sources":["../../../src/content/marquee/marquee.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"marquee.d.ts","sourceRoot":"","sources":["../../../src/content/marquee/marquee.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAI5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,eAAO,MAAM,kBAAkB,4BAA6B,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG;IAC5B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,EAAG,aAAsB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentSize, type ThemeColor, type VisualVariant } from '../../types';
|
|
2
2
|
export { BUTTON_TAG } from '../../inputs/button/button';
|
|
3
3
|
export { ICON_TAG } from '../icon/icon';
|
|
4
4
|
export type OrePaginationEvents = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/content/pagination/pagination.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/content/pagination/pagination.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAmB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGvG,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAkCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,cAAc,EAAG,gBAAyB,CAAC"}
|
|
@@ -29,46 +29,5 @@ export type OreQrCodeEvents = {
|
|
|
29
29
|
error: SigilError;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
/**
|
|
33
|
-
* Renders a QR code for `value` as inline SVG: themeable via `currentColor`,
|
|
34
|
-
* crisp at any scale, no canvas. On capacity errors the component shows an
|
|
35
|
-
* error state and emits `error` rather than throwing.
|
|
36
|
-
*
|
|
37
|
-
* @element ore-qr-code
|
|
38
|
-
*
|
|
39
|
-
* @attr {string} value - The payload to encode
|
|
40
|
-
* @attr {string} error-correction - 'L' | 'M' | 'Q' | 'H' (default 'M')
|
|
41
|
-
* @attr {number} margin - Quiet-zone modules (default 4)
|
|
42
|
-
* @attr {string} size - 'sm' | 'md' | 'lg', or a pixel value
|
|
43
|
-
* @attr {string} label - Accessible label (default "QR code")
|
|
44
|
-
* @attr {string} rounded - Border radius for the card variant
|
|
45
|
-
*
|
|
46
|
-
* @fires render - detail: `{ version, size }` after each successful render
|
|
47
|
-
* @fires error - detail: `{ error }` when encoding fails
|
|
48
|
-
*
|
|
49
|
-
* @slot caption - Optional caption rendered below the code
|
|
50
|
-
*
|
|
51
|
-
* @cssprop --qr-code-dark - Module color (default `currentColor`)
|
|
52
|
-
* @cssprop --qr-code-light - Background color (default `transparent`)
|
|
53
|
-
* @cssprop --qr-code-size - Rendered size in px (overrides `size`)
|
|
54
|
-
* @cssprop --qr-code-radius - Border radius
|
|
55
|
-
* @cssprop --qr-code-padding - Inner padding
|
|
56
|
-
* @cssprop --qr-code-bg - Card background (variant="card")
|
|
57
|
-
* @cssprop --qr-code-border - Card border width (variant="card")
|
|
58
|
-
* @cssprop --qr-code-border-color - Card border color (variant="card")
|
|
59
|
-
* @cssprop --qr-code-shadow - Card box shadow (variant="card")
|
|
60
|
-
* @cssprop --qr-code-error-color - Error-state text color
|
|
61
|
-
*
|
|
62
|
-
* @part wrapper - Outer container
|
|
63
|
-
* @part svg - The rendered `<svg>` element
|
|
64
|
-
* @part caption - Caption slot container
|
|
65
|
-
* @part error - Error-state container
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```html
|
|
69
|
-
* <ore-qr-code value="https://example.com"></ore-qr-code>
|
|
70
|
-
* <ore-qr-code value="otpauth://…" error-correction="H" size="256"></ore-qr-code>
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
32
|
export declare const QR_CODE_TAG: "ore-qr-code";
|
|
74
33
|
//# sourceMappingURL=qr-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../../src/content/qr-code/qr-code.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,iBAAiB,EAAE,UAAU,EAAS,MAAM,iBAAiB,CAAC;AAGtF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9D,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG;IAC3B,6BAA6B;IAC7B,kBAAkB,CAAC,EAAE,iBAAiB,CAAC;IACvC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,iDAAiD;IACjD,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;IAC9B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAC5B,6EAA6E;IAC7E,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,uFAAuF;IACvF,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,CAAC;CAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../../src/content/qr-code/qr-code.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,iBAAiB,EAAE,UAAU,EAAS,MAAM,iBAAiB,CAAC;AAGtF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9D,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG;IAC3B,6BAA6B;IAC7B,kBAAkB,CAAC,EAAE,iBAAiB,CAAC;IACvC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,iDAAiD;IACjD,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;IAC9B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAC5B,6EAA6E;IAC7E,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,uFAAuF;IACvF,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,CAAC;CAC9B,CAAC;AAiDF,eAAO,MAAM,WAAW,EAAG,aAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/content/separator/separator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/content/separator/separator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5D,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uBAAuB;IACvB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,aAAa,EAAG,eAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/content/stepper/step.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/content/stepper/step.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,aAAa,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAKjG,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,sFAAsF;IACtF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DensityLevel } from '../../types';
|
|
1
2
|
/** Table component properties */
|
|
2
3
|
export type OreTableProps = {
|
|
3
4
|
/** Adds a thicker outer border */
|
|
@@ -5,7 +6,7 @@ export type OreTableProps = {
|
|
|
5
6
|
/** Visible caption text: also used as the accessible table label via `aria-label` */
|
|
6
7
|
caption?: string;
|
|
7
8
|
/** Cell density: `'compact'` | `'cozy'` (default) | `'comfortable'` */
|
|
8
|
-
density?:
|
|
9
|
+
density?: DensityLevel;
|
|
9
10
|
/** Expands the table to 100% of its container width */
|
|
10
11
|
fullwidth?: boolean;
|
|
11
12
|
/** Applies a busy/disabled state with reduced opacity */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/content/table/table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/content/table/table.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhE,iCAAiC;AACjC,MAAM,MAAM,aAAa,GAAG;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAkKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,eAAO,MAAM,SAAS,EAAG,WAAoB,CAAC"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
+
declare const TEXT_ALIGNMENTS: readonly ["left", "center", "right", "justify"];
|
|
2
|
+
declare const TEXT_ELEMENTS: readonly ["span", "p", "div", "h1", "h2", "h3", "h4", "h5", "h6", "label", "code"];
|
|
3
|
+
declare const TEXT_COLORS: readonly ["primary", "secondary", "info", "success", "warning", "error", "heading", "body", "muted", "tertiary", "disabled", "contrast"];
|
|
4
|
+
declare const TEXT_SIZES: readonly ["2xs", "xs", "sm", "md", "lg", "xl", "2xl"];
|
|
5
|
+
declare const TEXT_VARIANTS: readonly ["body", "heading", "label", "caption", "overline", "code"];
|
|
6
|
+
declare const TEXT_WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
|
|
1
7
|
/** Text component properties */
|
|
2
8
|
export type OreTextProps = {
|
|
3
9
|
/** Text alignment */
|
|
4
|
-
align?:
|
|
10
|
+
align?: (typeof TEXT_ALIGNMENTS)[number];
|
|
5
11
|
/** Semantic HTML element to render as: sets the correct ARIA role/level on the host */
|
|
6
|
-
as?:
|
|
12
|
+
as?: (typeof TEXT_ELEMENTS)[number];
|
|
7
13
|
/** Text color (semantic + theme colors) */
|
|
8
|
-
color?:
|
|
14
|
+
color?: (typeof TEXT_COLORS)[number];
|
|
9
15
|
/** Italic text style */
|
|
10
16
|
italic?: boolean;
|
|
11
17
|
/** Clamp text to N lines with an ellipsis (multi-line truncation) */
|
|
12
18
|
lines?: number;
|
|
13
19
|
/** Text size: maps to --text-* tokens for body variants and --heading-* tokens for the heading variant */
|
|
14
|
-
size?:
|
|
20
|
+
size?: (typeof TEXT_SIZES)[number];
|
|
15
21
|
/** Enable single-line text truncation with ellipsis */
|
|
16
22
|
truncate?: boolean;
|
|
17
23
|
/** Text semantic variant */
|
|
18
|
-
variant?:
|
|
24
|
+
variant?: (typeof TEXT_VARIANTS)[number];
|
|
19
25
|
/** Font weight */
|
|
20
|
-
weight?:
|
|
26
|
+
weight?: (typeof TEXT_WEIGHTS)[number];
|
|
21
27
|
};
|
|
22
28
|
/**
|
|
23
29
|
* A typography component with semantic variants and responsive sizing.
|
|
@@ -52,4 +58,5 @@ export type OreTextProps = {
|
|
|
52
58
|
* ```
|
|
53
59
|
*/
|
|
54
60
|
export declare const TEXT_TAG: "ore-text";
|
|
61
|
+
export {};
|
|
55
62
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/content/text/text.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/content/text/text.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,eAAe,iDAAkD,CAAC;AACxE,QAAA,MAAM,aAAa,oFAAqF,CAAC;AACzG,QAAA,MAAM,WAAW,0IAaP,CAAC;AACX,QAAA,MAAM,UAAU,uDAAwD,CAAC;AACzE,QAAA,MAAM,aAAa,sEAAuE,CAAC;AAC3F,QAAA,MAAM,YAAY,mDAAoD,CAAC;AAEvE,gCAAgC;AAChC,MAAM,MAAM,YAAY,GAAG;IACzB,qBAAqB;IACrB,KAAK,CAAC,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;IACzC,uFAAuF;IACvF,EAAE,CAAC,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IACpC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;IACrC,wBAAwB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,IAAI,CAAC,EAAE,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACnC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IACzC,kBAAkB;IAClB,MAAM,CAAC,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC"}
|
package/dist/cookie-banner.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./inputs/shared/native-field-event.cjs"),t=require("./styles/mixins/accessibility.css.cjs"),n=require("./button.cjs"),r=require("./checkbox.cjs"),i=require("./feedback/cookie-banner/cookie-banner.css.cjs");let a=require("@vielzeug/ripple"),o=require("@vielzeug/ore");var s={acceptAll:`Accept all`,essential:`Essential`,essentialNote:`Required for the site to work`,heading:`Your privacy`,reject:`Reject non-essential`,save:`Save choices`},c=`ore-cookie-banner`;(0,o.define)(c,{props:{categories:o.prop.data([]),consent:o.prop.data({}),hideOnDecide:o.prop.bool(!0),labels:o.prop.data({}),position:o.prop.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./inputs/shared/native-field-event.cjs"),t=require("./styles/mixins/accessibility.css.cjs"),n=require("./button.cjs"),r=require("./checkbox.cjs"),i=require("./feedback/cookie-banner/cookie-banner.css.cjs");let a=require("@vielzeug/ripple"),o=require("@vielzeug/ore");var s={acceptAll:`Accept all`,essential:`Essential`,essentialNote:`Required for the site to work`,heading:`Your privacy`,reject:`Reject non-essential`,save:`Save choices`},c=`ore-cookie-banner`;(0,o.define)(c,{props:{categories:o.prop.data([]),consent:o.prop.data({}),hideOnDecide:o.prop.bool(!0),labels:o.prop.data({}),position:o.prop.oneOf([`bottom`,`top`])},setup(t){let n=(0,o.getHost)(),r=(0,o.useEmit)(),i=(0,o.createId)(`cookie-banner-heading`),c=(0,o.createId)(`cookie-banner-text`),l=(0,a.signal)({}),seedDraft=()=>{let e=t.consent.value??{};l.value=Object.fromEntries((t.categories.value??[]).map(t=>[t.id,e[t.id]===!0]))};(0,a.watch)(()=>t.consent.value,seedDraft),(0,a.watch)(()=>t.categories.value,seedDraft),seedDraft();let label=e=>t.labels.value?.[e]??s[e],u=null,focusCard=()=>{(n.shadowRoot?.querySelector(`.banner`)??n).focus()},decide=e=>{r(`decide`,{consent:{...e,essential:!0}}),t.hideOnDecide.value!==!1&&n.hide()},acceptAll=()=>{decide(Object.fromEntries((t.categories.value??[]).map(e=>[e.id,!0])))},reject=()=>{decide(Object.fromEntries((t.categories.value??[]).map(e=>[e.id,!1])))},save=()=>{decide({...l.value})},setCategory=(e,t)=>{l.value={...l.value,[e]:t}};n.show=()=>{n.hidden&&(u=document.activeElement instanceof HTMLElement?document.activeElement:null,seedDraft(),n.hidden=!1,focusCard())},n.hide=()=>{n.hidden=!0,u?.focus(),u=null};let categories=()=>t.categories.value??[];return o.html`
|
|
2
2
|
<div
|
|
3
3
|
class="banner"
|
|
4
4
|
part="banner"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-banner.cjs","names":[],"sources":["../src/feedback/cookie-banner/cookie-banner.ts"],"sourcesContent":["import { createId, define, each, getHost, html, prop, useEmit, when } from '@vielzeug/ore';\nimport { signal, watch } from '@vielzeug/ripple';\n\nimport { reducedMotionMixin } from '../../styles';\n\n// The child components this banner renders. The bare-import form is not enough:\n// the per-entry library build drops side-effect-only imports between entry\n// modules, so these re-export the tags as bindings: the bundler keeps the\n// module link, and importing `@vielzeug/refine/cookie-banner` registers\n// ore-button and ore-checkbox on its own.\n\nimport { eventFieldChecked } from '../../inputs/shared/native-field-event';\nimport componentStyles from './cookie-banner.css?inline';\n\nexport { BUTTON_TAG } from '../../inputs/button/button';\nexport { CHECKBOX_TAG } from '../../inputs/checkbox/checkbox';\n/** A consent category offered as an opt-in checkbox. `id` is the key the `decide` detail is built from. */\nexport type OreCookieBannerCategory = { description?: string; id: string; label: string };\n\n/** All rendered labels, each with an English default: pass translated strings for other locales. */\nexport type OreCookieBannerLabels = Partial<{\n acceptAll: string;\n essential: string;\n essentialNote: string;\n heading: string;\n reject: string;\n save: string;\n}>;\n\n/** The consent record emitted by `decide`: every category id plus `essential`, always true. */\nexport type CookieConsentRecord = Record<string, boolean>;\n\n/** Element interface exposing the imperative API for `ore-cookie-banner`. */\nexport interface CookieBannerElement extends HTMLElement, OreCookieBannerProps {\n /** Hides the banner without emitting anything: persistence stays with the consumer. */\n hide(): void;\n /** Shows the banner again, for example from a \"Cookie settings\" link after a decision. */\n show(): void;\n}\n\nexport type OreCookieBannerEvents = {\n /** A decision was made. `detail.consent` holds every category id; persist it and gate embeds on it. */\n decide: { consent: CookieConsentRecord };\n};\n\nexport type OreCookieBannerProps = {\n /** Optional categories rendered as checkboxes; \"Essential\" is always shown as always-on. */\n categories?: OreCookieBannerCategory[];\n /** Current consent record, used to seed the checkboxes when the banner is shown again. */\n consent?: CookieConsentRecord;\n /** Hides the banner automatically after `decide` fires (default true). Set false to keep it open. */\n hideOnDecide?: boolean;\n /** All rendered labels, each with an English default. */\n labels?: OreCookieBannerLabels;\n /** Viewport edge the banner docks to. */\n position?: 'bottom' | 'top';\n};\n\nconst DEFAULT_LABELS = {\n acceptAll: 'Accept all',\n essential: 'Essential',\n essentialNote: 'Required for the site to work',\n heading: 'Your privacy',\n reject: 'Reject non-essential',\n save: 'Save choices',\n} as const;\n\n/**\n * A fixed-position consent banner for cookie/tracker opt-in: a short policy text\n * (default slot, links included), optional per-category opt-in checkboxes with\n * descriptions, and accept-all / reject / save actions.\n *\n * The layout is a single column: heading, policy text, a scrollable category\n * panel, and actions, that scales linearly from one to many categories. Each\n * category renders as a checkbox row; its optional `description` passes through\n * the checkbox's `helper` mechanism, so it is both visible below the label and\n * linked to the control via `aria-describedby`. The category panel scrolls\n * internally when it exceeds `--cookie-banner-categories-max-height`, so the\n * banner itself never grows past the viewport.\n *\n * The banner owns presentation only. It never stores anything: listen for `decide`,\n * persist the emitted record yourself (localStorage, a CMP, your own backend), and\n * gate third-party embeds on it. The banner hides itself after `decide` unless\n * `hide-on-decide` is set to false. Call `show()` again to let the user revise\n * their choice.\n *\n * The banner is a non-modal `role=\"dialog\"`: screen readers announce it when it\n * appears, focus moves to the dialog card itself on `show()`: a neutral target,\n * so no action is preselected for keyboard users, and returns to the previously\n * focused element on `hide()`. A banner that is simply present at page load (never\n * shown via `show()`) does not steal focus and is not announced; consumers that\n * want a load-time announcement should call `show()` from a user gesture.\n *\n * The `decide` record contains exactly the currently configured category ids\n * (plus `essential`, always true). Replace: do not merge: the stored record\n * with it, so categories removed between sessions drop their stale keys.\n *\n * @element ore-cookie-banner\n *\n * @attr {string} position - Viewport edge: 'bottom' (default) | 'top'\n * @attr {boolean} hide-on-decide - Hides the banner after `decide` (default true)\n *\n * @fires decide - A decision was made. detail: { consent }: every category id plus `essential`, always true.\n *\n * @slot - Policy text, including links to the privacy policy and imprint\n *\n * @cssprop --cookie-banner-width - Maximum width of the banner card (default min(560px, viewport-fit))\n * @cssprop --cookie-banner-inset - Distance from the viewport edges (default --size-4)\n * @cssprop --cookie-banner-z-index - Stacking order (default --z-modal)\n * @cssprop --cookie-banner-categories-max-height - Category panel scroll threshold (default 16rem)\n *\n * @part banner - The banner card\n * @part text - The slot wrapper for the policy text\n * @part categories - The scrollable category panel\n * @part actions - The action buttons\n *\n * @example\n * ```html\n * <ore-cookie-banner>\n * We use cookies to keep you logged in and, with your consent, to embed music\n * from YouTube. <a href=\"/privacy\">Privacy policy</a>.\n * </ore-cookie-banner>\n * <script type=\"module\">\n * import '@vielzeug/refine/cookie-banner';\n *\n * const banner = document.querySelector('ore-cookie-banner');\n * banner.categories = [\n * { id: 'music', label: 'Music embeds', description: 'Embed music from YouTube' },\n * { id: 'stats', label: 'Statistics', description: 'Anonymous usage analytics' },\n * ];\n * banner.addEventListener('decide', (event) => {\n * localStorage.setItem('consent', JSON.stringify(event.detail.consent));\n * });\n * </script>\n * ```\n */\nexport const COOKIE_BANNER_TAG = 'ore-cookie-banner' as const;\ndefine<OreCookieBannerProps>(COOKIE_BANNER_TAG, {\n props: {\n categories: prop.data<OreCookieBannerCategory[]>([]),\n consent: prop.data<CookieConsentRecord>({}),\n hideOnDecide: prop.bool(true),\n labels: prop.data<Partial<OreCookieBannerLabels>>({}),\n position: prop.string<'bottom' | 'top'>(),\n },\n setup(props) {\n const host = getHost() as CookieBannerElement;\n const emit = useEmit<OreCookieBannerEvents>();\n const headingId = createId('cookie-banner-heading');\n const textId = createId('cookie-banner-text');\n\n // Working copy of the checkbox state while the banner is open; seeded from\n // `consent` whenever the banner is (re)shown.\n const draft = signal<CookieConsentRecord>({});\n\n const seedDraft = (): void => {\n const base = props.consent.value ?? {};\n draft.value = Object.fromEntries(\n (props.categories.value ?? []).map((category) => [category.id, base[category.id] === true]),\n );\n };\n watch(() => props.consent.value, seedDraft);\n watch(() => props.categories.value, seedDraft);\n seedDraft();\n\n const label = (key: keyof typeof DEFAULT_LABELS): string => props.labels.value?.[key] ?? DEFAULT_LABELS[key];\n\n // The element that had focus before the banner opened; `hide()` returns to it.\n let restoreFocusTo: HTMLElement | null = null;\n\n // Focus lands on the dialog card itself: a neutral target, so no action is\n // preselected for keyboard users. Screen readers announce the dialog's name\n // when focus enters it.\n const focusCard = (): void => {\n const card = host.shadowRoot?.querySelector<HTMLElement>('.banner');\n (card ?? host).focus();\n };\n\n const decide = (consent: CookieConsentRecord): void => {\n emit('decide', { consent: { ...consent, essential: true } });\n if (props.hideOnDecide.value !== false) host.hide();\n };\n\n const acceptAll = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, true])));\n };\n\n const reject = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, false])));\n };\n\n const save = (): void => {\n decide({ ...draft.value });\n };\n\n const setCategory = (id: string, checked: boolean): void => {\n draft.value = { ...draft.value, [id]: checked };\n };\n\n host.show = (): void => {\n if (!host.hidden) return;\n restoreFocusTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n seedDraft();\n host.hidden = false;\n focusCard();\n };\n host.hide = (): void => {\n host.hidden = true;\n restoreFocusTo?.focus();\n restoreFocusTo = null;\n };\n\n const categories = (): OreCookieBannerCategory[] => props.categories.value ?? [];\n\n return html`\n <div\n class=\"banner\"\n part=\"banner\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby=\"${headingId}\"\n aria-describedby=\"${textId}\"\n tabindex=\"-1\">\n <h2 class=\"heading\" part=\"heading\" id=\"${headingId}\">${() => label('heading')}</h2>\n <div class=\"text\" part=\"text\" id=\"${textId}\">\n <slot></slot>\n </div>\n ${when(\n () => categories().length > 0,\n () => html`\n <div class=\"categories\" part=\"categories\">\n <div class=\"category-row\">\n <ore-checkbox checked disabled helper=\"${() => label('essentialNote')}\">\n ${() => label('essential')}\n </ore-checkbox>\n </div>\n ${each(\n categories,\n (category) => category.id,\n (category) => html`\n <div class=\"category-row\">\n <ore-checkbox\n checked=\"${() => draft.value[category.value.id] === true}\"\n helper=\"${() => category.value.description ?? ''}\"\n @change=\"${(event: Event) => setCategory(category.value.id, eventFieldChecked(event))}\">\n ${() => category.value.label}\n </ore-checkbox>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <div class=\"actions\" part=\"actions\">\n <ore-button size=\"sm\" variant=\"ghost\" @click=\"${reject}\">${() => label('reject')}</ore-button>\n ${when(\n () => categories().length > 0,\n () => html`<ore-button size=\"sm\" variant=\"bordered\" @click=\"${save}\">${() => label('save')}</ore-button>`,\n )}\n <ore-button color=\"primary\" size=\"sm\" @click=\"${acceptAll}\">${() => label('acceptAll')}</ore-button>\n </div>\n </div>\n `;\n },\n styles: [reducedMotionMixin, componentStyles],\n});\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"cookie-banner.cjs","names":[],"sources":["../src/feedback/cookie-banner/cookie-banner.ts"],"sourcesContent":["import { createId, define, each, getHost, html, prop, useEmit, when } from '@vielzeug/ore';\nimport { signal, watch } from '@vielzeug/ripple';\n\nimport { reducedMotionMixin } from '../../styles';\n\n// The child components this banner renders. The bare-import form is not enough:\n// the per-entry library build drops side-effect-only imports between entry\n// modules, so these re-export the tags as bindings: the bundler keeps the\n// module link, and importing `@vielzeug/refine/cookie-banner` registers\n// ore-button and ore-checkbox on its own.\n\nimport { eventFieldChecked } from '../../inputs/shared/native-field-event';\nimport componentStyles from './cookie-banner.css?inline';\n\nexport { BUTTON_TAG } from '../../inputs/button/button';\nexport { CHECKBOX_TAG } from '../../inputs/checkbox/checkbox';\n/** A consent category offered as an opt-in checkbox. `id` is the key the `decide` detail is built from. */\nexport type OreCookieBannerCategory = { description?: string; id: string; label: string };\n\n/** All rendered labels, each with an English default: pass translated strings for other locales. */\nexport type OreCookieBannerLabels = Partial<{\n acceptAll: string;\n essential: string;\n essentialNote: string;\n heading: string;\n reject: string;\n save: string;\n}>;\n\n/** The consent record emitted by `decide`: every category id plus `essential`, always true. */\nexport type CookieConsentRecord = Record<string, boolean>;\n\n/** Element interface exposing the imperative API for `ore-cookie-banner`. */\nexport interface CookieBannerElement extends HTMLElement, OreCookieBannerProps {\n /** Hides the banner without emitting anything: persistence stays with the consumer. */\n hide(): void;\n /** Shows the banner again, for example from a \"Cookie settings\" link after a decision. */\n show(): void;\n}\n\nexport type OreCookieBannerEvents = {\n /** A decision was made. `detail.consent` holds every category id; persist it and gate embeds on it. */\n decide: { consent: CookieConsentRecord };\n};\n\nexport type OreCookieBannerProps = {\n /** Optional categories rendered as checkboxes; \"Essential\" is always shown as always-on. */\n categories?: OreCookieBannerCategory[];\n /** Current consent record, used to seed the checkboxes when the banner is shown again. */\n consent?: CookieConsentRecord;\n /** Hides the banner automatically after `decide` fires (default true). Set false to keep it open. */\n hideOnDecide?: boolean;\n /** All rendered labels, each with an English default. */\n labels?: OreCookieBannerLabels;\n /** Viewport edge the banner docks to. */\n position?: 'bottom' | 'top';\n};\n\nconst DEFAULT_LABELS = {\n acceptAll: 'Accept all',\n essential: 'Essential',\n essentialNote: 'Required for the site to work',\n heading: 'Your privacy',\n reject: 'Reject non-essential',\n save: 'Save choices',\n} as const;\n\n/**\n * A fixed-position consent banner for cookie/tracker opt-in: a short policy text\n * (default slot, links included), optional per-category opt-in checkboxes with\n * descriptions, and accept-all / reject / save actions.\n *\n * The layout is a single column: heading, policy text, a scrollable category\n * panel, and actions, that scales linearly from one to many categories. Each\n * category renders as a checkbox row; its optional `description` passes through\n * the checkbox's `helper` mechanism, so it is both visible below the label and\n * linked to the control via `aria-describedby`. The category panel scrolls\n * internally when it exceeds `--cookie-banner-categories-max-height`, so the\n * banner itself never grows past the viewport.\n *\n * The banner owns presentation only. It never stores anything: listen for `decide`,\n * persist the emitted record yourself (localStorage, a CMP, your own backend), and\n * gate third-party embeds on it. The banner hides itself after `decide` unless\n * `hide-on-decide` is set to false. Call `show()` again to let the user revise\n * their choice.\n *\n * The banner is a non-modal `role=\"dialog\"`: screen readers announce it when it\n * appears, focus moves to the dialog card itself on `show()`: a neutral target,\n * so no action is preselected for keyboard users, and returns to the previously\n * focused element on `hide()`. A banner that is simply present at page load (never\n * shown via `show()`) does not steal focus and is not announced; consumers that\n * want a load-time announcement should call `show()` from a user gesture.\n *\n * The `decide` record contains exactly the currently configured category ids\n * (plus `essential`, always true). Replace: do not merge: the stored record\n * with it, so categories removed between sessions drop their stale keys.\n *\n * @element ore-cookie-banner\n *\n * @attr {string} position - Viewport edge: 'bottom' (default) | 'top'\n * @attr {boolean} hide-on-decide - Hides the banner after `decide` (default true)\n *\n * @fires decide - A decision was made. detail: { consent }: every category id plus `essential`, always true.\n *\n * @slot - Policy text, including links to the privacy policy and imprint\n *\n * @cssprop --cookie-banner-width - Maximum width of the banner card (default min(560px, viewport-fit))\n * @cssprop --cookie-banner-inset - Distance from the viewport edges (default --size-4)\n * @cssprop --cookie-banner-z-index - Stacking order (default --z-modal)\n * @cssprop --cookie-banner-categories-max-height - Category panel scroll threshold (default 16rem)\n *\n * @part banner - The banner card\n * @part text - The slot wrapper for the policy text\n * @part categories - The scrollable category panel\n * @part actions - The action buttons\n *\n * @example\n * ```html\n * <ore-cookie-banner>\n * We use cookies to keep you logged in and, with your consent, to embed music\n * from YouTube. <a href=\"/privacy\">Privacy policy</a>.\n * </ore-cookie-banner>\n * <script type=\"module\">\n * import '@vielzeug/refine/cookie-banner';\n *\n * const banner = document.querySelector('ore-cookie-banner');\n * banner.categories = [\n * { id: 'music', label: 'Music embeds', description: 'Embed music from YouTube' },\n * { id: 'stats', label: 'Statistics', description: 'Anonymous usage analytics' },\n * ];\n * banner.addEventListener('decide', (event) => {\n * localStorage.setItem('consent', JSON.stringify(event.detail.consent));\n * });\n * </script>\n * ```\n */\nexport const COOKIE_BANNER_TAG = 'ore-cookie-banner' as const;\ndefine<OreCookieBannerProps>(COOKIE_BANNER_TAG, {\n props: {\n categories: prop.data<OreCookieBannerCategory[]>([]),\n consent: prop.data<CookieConsentRecord>({}),\n hideOnDecide: prop.bool(true),\n labels: prop.data<Partial<OreCookieBannerLabels>>({}),\n position: prop.oneOf(['bottom', 'top'] as const),\n },\n setup(props) {\n const host = getHost() as CookieBannerElement;\n const emit = useEmit<OreCookieBannerEvents>();\n const headingId = createId('cookie-banner-heading');\n const textId = createId('cookie-banner-text');\n\n // Working copy of the checkbox state while the banner is open; seeded from\n // `consent` whenever the banner is (re)shown.\n const draft = signal<CookieConsentRecord>({});\n\n const seedDraft = (): void => {\n const base = props.consent.value ?? {};\n draft.value = Object.fromEntries(\n (props.categories.value ?? []).map((category) => [category.id, base[category.id] === true]),\n );\n };\n watch(() => props.consent.value, seedDraft);\n watch(() => props.categories.value, seedDraft);\n seedDraft();\n\n const label = (key: keyof typeof DEFAULT_LABELS): string => props.labels.value?.[key] ?? DEFAULT_LABELS[key];\n\n // The element that had focus before the banner opened; `hide()` returns to it.\n let restoreFocusTo: HTMLElement | null = null;\n\n // Focus lands on the dialog card itself: a neutral target, so no action is\n // preselected for keyboard users. Screen readers announce the dialog's name\n // when focus enters it.\n const focusCard = (): void => {\n const card = host.shadowRoot?.querySelector<HTMLElement>('.banner');\n (card ?? host).focus();\n };\n\n const decide = (consent: CookieConsentRecord): void => {\n emit('decide', { consent: { ...consent, essential: true } });\n if (props.hideOnDecide.value !== false) host.hide();\n };\n\n const acceptAll = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, true])));\n };\n\n const reject = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, false])));\n };\n\n const save = (): void => {\n decide({ ...draft.value });\n };\n\n const setCategory = (id: string, checked: boolean): void => {\n draft.value = { ...draft.value, [id]: checked };\n };\n\n host.show = (): void => {\n if (!host.hidden) return;\n restoreFocusTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n seedDraft();\n host.hidden = false;\n focusCard();\n };\n host.hide = (): void => {\n host.hidden = true;\n restoreFocusTo?.focus();\n restoreFocusTo = null;\n };\n\n const categories = (): OreCookieBannerCategory[] => props.categories.value ?? [];\n\n return html`\n <div\n class=\"banner\"\n part=\"banner\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby=\"${headingId}\"\n aria-describedby=\"${textId}\"\n tabindex=\"-1\">\n <h2 class=\"heading\" part=\"heading\" id=\"${headingId}\">${() => label('heading')}</h2>\n <div class=\"text\" part=\"text\" id=\"${textId}\">\n <slot></slot>\n </div>\n ${when(\n () => categories().length > 0,\n () => html`\n <div class=\"categories\" part=\"categories\">\n <div class=\"category-row\">\n <ore-checkbox checked disabled helper=\"${() => label('essentialNote')}\">\n ${() => label('essential')}\n </ore-checkbox>\n </div>\n ${each(\n categories,\n (category) => category.id,\n (category) => html`\n <div class=\"category-row\">\n <ore-checkbox\n checked=\"${() => draft.value[category.value.id] === true}\"\n helper=\"${() => category.value.description ?? ''}\"\n @change=\"${(event: Event) => setCategory(category.value.id, eventFieldChecked(event))}\">\n ${() => category.value.label}\n </ore-checkbox>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <div class=\"actions\" part=\"actions\">\n <ore-button size=\"sm\" variant=\"ghost\" @click=\"${reject}\">${() => label('reject')}</ore-button>\n ${when(\n () => categories().length > 0,\n () => html`<ore-button size=\"sm\" variant=\"bordered\" @click=\"${save}\">${() => label('save')}</ore-button>`,\n )}\n <ore-button color=\"primary\" size=\"sm\" @click=\"${acceptAll}\">${() => label('acceptAll')}</ore-button>\n </div>\n </div>\n `;\n },\n styles: [reducedMotionMixin, componentStyles],\n});\n"],"mappings":"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"}
|
package/dist/cookie-banner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{eventFieldChecked as e}from"./inputs/shared/native-field-event.js";import{reducedMotionMixin as t}from"./styles/mixins/accessibility.css.js";import{BUTTON_TAG as n}from"./button.js";import{CHECKBOX_TAG as r}from"./checkbox.js";import i from"./feedback/cookie-banner/cookie-banner.css.js";import{signal as a,watch as o}from"@vielzeug/ripple";import{createId as s,define as c,each as l,getHost as u,html as d,prop as f,useEmit as p,when as m}from"@vielzeug/ore";var h={acceptAll:`Accept all`,essential:`Essential`,essentialNote:`Required for the site to work`,heading:`Your privacy`,reject:`Reject non-essential`,save:`Save choices`},g=`ore-cookie-banner`;c(g,{props:{categories:f.data([]),consent:f.data({}),hideOnDecide:f.bool(!0),labels:f.data({}),position:f.
|
|
1
|
+
import{eventFieldChecked as e}from"./inputs/shared/native-field-event.js";import{reducedMotionMixin as t}from"./styles/mixins/accessibility.css.js";import{BUTTON_TAG as n}from"./button.js";import{CHECKBOX_TAG as r}from"./checkbox.js";import i from"./feedback/cookie-banner/cookie-banner.css.js";import{signal as a,watch as o}from"@vielzeug/ripple";import{createId as s,define as c,each as l,getHost as u,html as d,prop as f,useEmit as p,when as m}from"@vielzeug/ore";var h={acceptAll:`Accept all`,essential:`Essential`,essentialNote:`Required for the site to work`,heading:`Your privacy`,reject:`Reject non-essential`,save:`Save choices`},g=`ore-cookie-banner`;c(g,{props:{categories:f.data([]),consent:f.data({}),hideOnDecide:f.bool(!0),labels:f.data({}),position:f.oneOf([`bottom`,`top`])},setup(t){let n=u(),r=p(),i=s(`cookie-banner-heading`),c=s(`cookie-banner-text`),f=a({}),seedDraft=()=>{let e=t.consent.value??{};f.value=Object.fromEntries((t.categories.value??[]).map(t=>[t.id,e[t.id]===!0]))};o(()=>t.consent.value,seedDraft),o(()=>t.categories.value,seedDraft),seedDraft();let label=e=>t.labels.value?.[e]??h[e],g=null,focusCard=()=>{(n.shadowRoot?.querySelector(`.banner`)??n).focus()},decide=e=>{r(`decide`,{consent:{...e,essential:!0}}),t.hideOnDecide.value!==!1&&n.hide()},acceptAll=()=>{decide(Object.fromEntries((t.categories.value??[]).map(e=>[e.id,!0])))},reject=()=>{decide(Object.fromEntries((t.categories.value??[]).map(e=>[e.id,!1])))},save=()=>{decide({...f.value})},setCategory=(e,t)=>{f.value={...f.value,[e]:t}};n.show=()=>{n.hidden&&(g=document.activeElement instanceof HTMLElement?document.activeElement:null,seedDraft(),n.hidden=!1,focusCard())},n.hide=()=>{n.hidden=!0,g?.focus(),g=null};let categories=()=>t.categories.value??[];return d`
|
|
2
2
|
<div
|
|
3
3
|
class="banner"
|
|
4
4
|
part="banner"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-banner.js","names":[],"sources":["../src/feedback/cookie-banner/cookie-banner.ts"],"sourcesContent":["import { createId, define, each, getHost, html, prop, useEmit, when } from '@vielzeug/ore';\nimport { signal, watch } from '@vielzeug/ripple';\n\nimport { reducedMotionMixin } from '../../styles';\n\n// The child components this banner renders. The bare-import form is not enough:\n// the per-entry library build drops side-effect-only imports between entry\n// modules, so these re-export the tags as bindings: the bundler keeps the\n// module link, and importing `@vielzeug/refine/cookie-banner` registers\n// ore-button and ore-checkbox on its own.\n\nimport { eventFieldChecked } from '../../inputs/shared/native-field-event';\nimport componentStyles from './cookie-banner.css?inline';\n\nexport { BUTTON_TAG } from '../../inputs/button/button';\nexport { CHECKBOX_TAG } from '../../inputs/checkbox/checkbox';\n/** A consent category offered as an opt-in checkbox. `id` is the key the `decide` detail is built from. */\nexport type OreCookieBannerCategory = { description?: string; id: string; label: string };\n\n/** All rendered labels, each with an English default: pass translated strings for other locales. */\nexport type OreCookieBannerLabels = Partial<{\n acceptAll: string;\n essential: string;\n essentialNote: string;\n heading: string;\n reject: string;\n save: string;\n}>;\n\n/** The consent record emitted by `decide`: every category id plus `essential`, always true. */\nexport type CookieConsentRecord = Record<string, boolean>;\n\n/** Element interface exposing the imperative API for `ore-cookie-banner`. */\nexport interface CookieBannerElement extends HTMLElement, OreCookieBannerProps {\n /** Hides the banner without emitting anything: persistence stays with the consumer. */\n hide(): void;\n /** Shows the banner again, for example from a \"Cookie settings\" link after a decision. */\n show(): void;\n}\n\nexport type OreCookieBannerEvents = {\n /** A decision was made. `detail.consent` holds every category id; persist it and gate embeds on it. */\n decide: { consent: CookieConsentRecord };\n};\n\nexport type OreCookieBannerProps = {\n /** Optional categories rendered as checkboxes; \"Essential\" is always shown as always-on. */\n categories?: OreCookieBannerCategory[];\n /** Current consent record, used to seed the checkboxes when the banner is shown again. */\n consent?: CookieConsentRecord;\n /** Hides the banner automatically after `decide` fires (default true). Set false to keep it open. */\n hideOnDecide?: boolean;\n /** All rendered labels, each with an English default. */\n labels?: OreCookieBannerLabels;\n /** Viewport edge the banner docks to. */\n position?: 'bottom' | 'top';\n};\n\nconst DEFAULT_LABELS = {\n acceptAll: 'Accept all',\n essential: 'Essential',\n essentialNote: 'Required for the site to work',\n heading: 'Your privacy',\n reject: 'Reject non-essential',\n save: 'Save choices',\n} as const;\n\n/**\n * A fixed-position consent banner for cookie/tracker opt-in: a short policy text\n * (default slot, links included), optional per-category opt-in checkboxes with\n * descriptions, and accept-all / reject / save actions.\n *\n * The layout is a single column: heading, policy text, a scrollable category\n * panel, and actions, that scales linearly from one to many categories. Each\n * category renders as a checkbox row; its optional `description` passes through\n * the checkbox's `helper` mechanism, so it is both visible below the label and\n * linked to the control via `aria-describedby`. The category panel scrolls\n * internally when it exceeds `--cookie-banner-categories-max-height`, so the\n * banner itself never grows past the viewport.\n *\n * The banner owns presentation only. It never stores anything: listen for `decide`,\n * persist the emitted record yourself (localStorage, a CMP, your own backend), and\n * gate third-party embeds on it. The banner hides itself after `decide` unless\n * `hide-on-decide` is set to false. Call `show()` again to let the user revise\n * their choice.\n *\n * The banner is a non-modal `role=\"dialog\"`: screen readers announce it when it\n * appears, focus moves to the dialog card itself on `show()`: a neutral target,\n * so no action is preselected for keyboard users, and returns to the previously\n * focused element on `hide()`. A banner that is simply present at page load (never\n * shown via `show()`) does not steal focus and is not announced; consumers that\n * want a load-time announcement should call `show()` from a user gesture.\n *\n * The `decide` record contains exactly the currently configured category ids\n * (plus `essential`, always true). Replace: do not merge: the stored record\n * with it, so categories removed between sessions drop their stale keys.\n *\n * @element ore-cookie-banner\n *\n * @attr {string} position - Viewport edge: 'bottom' (default) | 'top'\n * @attr {boolean} hide-on-decide - Hides the banner after `decide` (default true)\n *\n * @fires decide - A decision was made. detail: { consent }: every category id plus `essential`, always true.\n *\n * @slot - Policy text, including links to the privacy policy and imprint\n *\n * @cssprop --cookie-banner-width - Maximum width of the banner card (default min(560px, viewport-fit))\n * @cssprop --cookie-banner-inset - Distance from the viewport edges (default --size-4)\n * @cssprop --cookie-banner-z-index - Stacking order (default --z-modal)\n * @cssprop --cookie-banner-categories-max-height - Category panel scroll threshold (default 16rem)\n *\n * @part banner - The banner card\n * @part text - The slot wrapper for the policy text\n * @part categories - The scrollable category panel\n * @part actions - The action buttons\n *\n * @example\n * ```html\n * <ore-cookie-banner>\n * We use cookies to keep you logged in and, with your consent, to embed music\n * from YouTube. <a href=\"/privacy\">Privacy policy</a>.\n * </ore-cookie-banner>\n * <script type=\"module\">\n * import '@vielzeug/refine/cookie-banner';\n *\n * const banner = document.querySelector('ore-cookie-banner');\n * banner.categories = [\n * { id: 'music', label: 'Music embeds', description: 'Embed music from YouTube' },\n * { id: 'stats', label: 'Statistics', description: 'Anonymous usage analytics' },\n * ];\n * banner.addEventListener('decide', (event) => {\n * localStorage.setItem('consent', JSON.stringify(event.detail.consent));\n * });\n * </script>\n * ```\n */\nexport const COOKIE_BANNER_TAG = 'ore-cookie-banner' as const;\ndefine<OreCookieBannerProps>(COOKIE_BANNER_TAG, {\n props: {\n categories: prop.data<OreCookieBannerCategory[]>([]),\n consent: prop.data<CookieConsentRecord>({}),\n hideOnDecide: prop.bool(true),\n labels: prop.data<Partial<OreCookieBannerLabels>>({}),\n position: prop.string<'bottom' | 'top'>(),\n },\n setup(props) {\n const host = getHost() as CookieBannerElement;\n const emit = useEmit<OreCookieBannerEvents>();\n const headingId = createId('cookie-banner-heading');\n const textId = createId('cookie-banner-text');\n\n // Working copy of the checkbox state while the banner is open; seeded from\n // `consent` whenever the banner is (re)shown.\n const draft = signal<CookieConsentRecord>({});\n\n const seedDraft = (): void => {\n const base = props.consent.value ?? {};\n draft.value = Object.fromEntries(\n (props.categories.value ?? []).map((category) => [category.id, base[category.id] === true]),\n );\n };\n watch(() => props.consent.value, seedDraft);\n watch(() => props.categories.value, seedDraft);\n seedDraft();\n\n const label = (key: keyof typeof DEFAULT_LABELS): string => props.labels.value?.[key] ?? DEFAULT_LABELS[key];\n\n // The element that had focus before the banner opened; `hide()` returns to it.\n let restoreFocusTo: HTMLElement | null = null;\n\n // Focus lands on the dialog card itself: a neutral target, so no action is\n // preselected for keyboard users. Screen readers announce the dialog's name\n // when focus enters it.\n const focusCard = (): void => {\n const card = host.shadowRoot?.querySelector<HTMLElement>('.banner');\n (card ?? host).focus();\n };\n\n const decide = (consent: CookieConsentRecord): void => {\n emit('decide', { consent: { ...consent, essential: true } });\n if (props.hideOnDecide.value !== false) host.hide();\n };\n\n const acceptAll = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, true])));\n };\n\n const reject = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, false])));\n };\n\n const save = (): void => {\n decide({ ...draft.value });\n };\n\n const setCategory = (id: string, checked: boolean): void => {\n draft.value = { ...draft.value, [id]: checked };\n };\n\n host.show = (): void => {\n if (!host.hidden) return;\n restoreFocusTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n seedDraft();\n host.hidden = false;\n focusCard();\n };\n host.hide = (): void => {\n host.hidden = true;\n restoreFocusTo?.focus();\n restoreFocusTo = null;\n };\n\n const categories = (): OreCookieBannerCategory[] => props.categories.value ?? [];\n\n return html`\n <div\n class=\"banner\"\n part=\"banner\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby=\"${headingId}\"\n aria-describedby=\"${textId}\"\n tabindex=\"-1\">\n <h2 class=\"heading\" part=\"heading\" id=\"${headingId}\">${() => label('heading')}</h2>\n <div class=\"text\" part=\"text\" id=\"${textId}\">\n <slot></slot>\n </div>\n ${when(\n () => categories().length > 0,\n () => html`\n <div class=\"categories\" part=\"categories\">\n <div class=\"category-row\">\n <ore-checkbox checked disabled helper=\"${() => label('essentialNote')}\">\n ${() => label('essential')}\n </ore-checkbox>\n </div>\n ${each(\n categories,\n (category) => category.id,\n (category) => html`\n <div class=\"category-row\">\n <ore-checkbox\n checked=\"${() => draft.value[category.value.id] === true}\"\n helper=\"${() => category.value.description ?? ''}\"\n @change=\"${(event: Event) => setCategory(category.value.id, eventFieldChecked(event))}\">\n ${() => category.value.label}\n </ore-checkbox>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <div class=\"actions\" part=\"actions\">\n <ore-button size=\"sm\" variant=\"ghost\" @click=\"${reject}\">${() => label('reject')}</ore-button>\n ${when(\n () => categories().length > 0,\n () => html`<ore-button size=\"sm\" variant=\"bordered\" @click=\"${save}\">${() => label('save')}</ore-button>`,\n )}\n <ore-button color=\"primary\" size=\"sm\" @click=\"${acceptAll}\">${() => label('acceptAll')}</ore-button>\n </div>\n </div>\n `;\n },\n styles: [reducedMotionMixin, componentStyles],\n});\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"cookie-banner.js","names":[],"sources":["../src/feedback/cookie-banner/cookie-banner.ts"],"sourcesContent":["import { createId, define, each, getHost, html, prop, useEmit, when } from '@vielzeug/ore';\nimport { signal, watch } from '@vielzeug/ripple';\n\nimport { reducedMotionMixin } from '../../styles';\n\n// The child components this banner renders. The bare-import form is not enough:\n// the per-entry library build drops side-effect-only imports between entry\n// modules, so these re-export the tags as bindings: the bundler keeps the\n// module link, and importing `@vielzeug/refine/cookie-banner` registers\n// ore-button and ore-checkbox on its own.\n\nimport { eventFieldChecked } from '../../inputs/shared/native-field-event';\nimport componentStyles from './cookie-banner.css?inline';\n\nexport { BUTTON_TAG } from '../../inputs/button/button';\nexport { CHECKBOX_TAG } from '../../inputs/checkbox/checkbox';\n/** A consent category offered as an opt-in checkbox. `id` is the key the `decide` detail is built from. */\nexport type OreCookieBannerCategory = { description?: string; id: string; label: string };\n\n/** All rendered labels, each with an English default: pass translated strings for other locales. */\nexport type OreCookieBannerLabels = Partial<{\n acceptAll: string;\n essential: string;\n essentialNote: string;\n heading: string;\n reject: string;\n save: string;\n}>;\n\n/** The consent record emitted by `decide`: every category id plus `essential`, always true. */\nexport type CookieConsentRecord = Record<string, boolean>;\n\n/** Element interface exposing the imperative API for `ore-cookie-banner`. */\nexport interface CookieBannerElement extends HTMLElement, OreCookieBannerProps {\n /** Hides the banner without emitting anything: persistence stays with the consumer. */\n hide(): void;\n /** Shows the banner again, for example from a \"Cookie settings\" link after a decision. */\n show(): void;\n}\n\nexport type OreCookieBannerEvents = {\n /** A decision was made. `detail.consent` holds every category id; persist it and gate embeds on it. */\n decide: { consent: CookieConsentRecord };\n};\n\nexport type OreCookieBannerProps = {\n /** Optional categories rendered as checkboxes; \"Essential\" is always shown as always-on. */\n categories?: OreCookieBannerCategory[];\n /** Current consent record, used to seed the checkboxes when the banner is shown again. */\n consent?: CookieConsentRecord;\n /** Hides the banner automatically after `decide` fires (default true). Set false to keep it open. */\n hideOnDecide?: boolean;\n /** All rendered labels, each with an English default. */\n labels?: OreCookieBannerLabels;\n /** Viewport edge the banner docks to. */\n position?: 'bottom' | 'top';\n};\n\nconst DEFAULT_LABELS = {\n acceptAll: 'Accept all',\n essential: 'Essential',\n essentialNote: 'Required for the site to work',\n heading: 'Your privacy',\n reject: 'Reject non-essential',\n save: 'Save choices',\n} as const;\n\n/**\n * A fixed-position consent banner for cookie/tracker opt-in: a short policy text\n * (default slot, links included), optional per-category opt-in checkboxes with\n * descriptions, and accept-all / reject / save actions.\n *\n * The layout is a single column: heading, policy text, a scrollable category\n * panel, and actions, that scales linearly from one to many categories. Each\n * category renders as a checkbox row; its optional `description` passes through\n * the checkbox's `helper` mechanism, so it is both visible below the label and\n * linked to the control via `aria-describedby`. The category panel scrolls\n * internally when it exceeds `--cookie-banner-categories-max-height`, so the\n * banner itself never grows past the viewport.\n *\n * The banner owns presentation only. It never stores anything: listen for `decide`,\n * persist the emitted record yourself (localStorage, a CMP, your own backend), and\n * gate third-party embeds on it. The banner hides itself after `decide` unless\n * `hide-on-decide` is set to false. Call `show()` again to let the user revise\n * their choice.\n *\n * The banner is a non-modal `role=\"dialog\"`: screen readers announce it when it\n * appears, focus moves to the dialog card itself on `show()`: a neutral target,\n * so no action is preselected for keyboard users, and returns to the previously\n * focused element on `hide()`. A banner that is simply present at page load (never\n * shown via `show()`) does not steal focus and is not announced; consumers that\n * want a load-time announcement should call `show()` from a user gesture.\n *\n * The `decide` record contains exactly the currently configured category ids\n * (plus `essential`, always true). Replace: do not merge: the stored record\n * with it, so categories removed between sessions drop their stale keys.\n *\n * @element ore-cookie-banner\n *\n * @attr {string} position - Viewport edge: 'bottom' (default) | 'top'\n * @attr {boolean} hide-on-decide - Hides the banner after `decide` (default true)\n *\n * @fires decide - A decision was made. detail: { consent }: every category id plus `essential`, always true.\n *\n * @slot - Policy text, including links to the privacy policy and imprint\n *\n * @cssprop --cookie-banner-width - Maximum width of the banner card (default min(560px, viewport-fit))\n * @cssprop --cookie-banner-inset - Distance from the viewport edges (default --size-4)\n * @cssprop --cookie-banner-z-index - Stacking order (default --z-modal)\n * @cssprop --cookie-banner-categories-max-height - Category panel scroll threshold (default 16rem)\n *\n * @part banner - The banner card\n * @part text - The slot wrapper for the policy text\n * @part categories - The scrollable category panel\n * @part actions - The action buttons\n *\n * @example\n * ```html\n * <ore-cookie-banner>\n * We use cookies to keep you logged in and, with your consent, to embed music\n * from YouTube. <a href=\"/privacy\">Privacy policy</a>.\n * </ore-cookie-banner>\n * <script type=\"module\">\n * import '@vielzeug/refine/cookie-banner';\n *\n * const banner = document.querySelector('ore-cookie-banner');\n * banner.categories = [\n * { id: 'music', label: 'Music embeds', description: 'Embed music from YouTube' },\n * { id: 'stats', label: 'Statistics', description: 'Anonymous usage analytics' },\n * ];\n * banner.addEventListener('decide', (event) => {\n * localStorage.setItem('consent', JSON.stringify(event.detail.consent));\n * });\n * </script>\n * ```\n */\nexport const COOKIE_BANNER_TAG = 'ore-cookie-banner' as const;\ndefine<OreCookieBannerProps>(COOKIE_BANNER_TAG, {\n props: {\n categories: prop.data<OreCookieBannerCategory[]>([]),\n consent: prop.data<CookieConsentRecord>({}),\n hideOnDecide: prop.bool(true),\n labels: prop.data<Partial<OreCookieBannerLabels>>({}),\n position: prop.oneOf(['bottom', 'top'] as const),\n },\n setup(props) {\n const host = getHost() as CookieBannerElement;\n const emit = useEmit<OreCookieBannerEvents>();\n const headingId = createId('cookie-banner-heading');\n const textId = createId('cookie-banner-text');\n\n // Working copy of the checkbox state while the banner is open; seeded from\n // `consent` whenever the banner is (re)shown.\n const draft = signal<CookieConsentRecord>({});\n\n const seedDraft = (): void => {\n const base = props.consent.value ?? {};\n draft.value = Object.fromEntries(\n (props.categories.value ?? []).map((category) => [category.id, base[category.id] === true]),\n );\n };\n watch(() => props.consent.value, seedDraft);\n watch(() => props.categories.value, seedDraft);\n seedDraft();\n\n const label = (key: keyof typeof DEFAULT_LABELS): string => props.labels.value?.[key] ?? DEFAULT_LABELS[key];\n\n // The element that had focus before the banner opened; `hide()` returns to it.\n let restoreFocusTo: HTMLElement | null = null;\n\n // Focus lands on the dialog card itself: a neutral target, so no action is\n // preselected for keyboard users. Screen readers announce the dialog's name\n // when focus enters it.\n const focusCard = (): void => {\n const card = host.shadowRoot?.querySelector<HTMLElement>('.banner');\n (card ?? host).focus();\n };\n\n const decide = (consent: CookieConsentRecord): void => {\n emit('decide', { consent: { ...consent, essential: true } });\n if (props.hideOnDecide.value !== false) host.hide();\n };\n\n const acceptAll = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, true])));\n };\n\n const reject = (): void => {\n decide(Object.fromEntries((props.categories.value ?? []).map((category) => [category.id, false])));\n };\n\n const save = (): void => {\n decide({ ...draft.value });\n };\n\n const setCategory = (id: string, checked: boolean): void => {\n draft.value = { ...draft.value, [id]: checked };\n };\n\n host.show = (): void => {\n if (!host.hidden) return;\n restoreFocusTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n seedDraft();\n host.hidden = false;\n focusCard();\n };\n host.hide = (): void => {\n host.hidden = true;\n restoreFocusTo?.focus();\n restoreFocusTo = null;\n };\n\n const categories = (): OreCookieBannerCategory[] => props.categories.value ?? [];\n\n return html`\n <div\n class=\"banner\"\n part=\"banner\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby=\"${headingId}\"\n aria-describedby=\"${textId}\"\n tabindex=\"-1\">\n <h2 class=\"heading\" part=\"heading\" id=\"${headingId}\">${() => label('heading')}</h2>\n <div class=\"text\" part=\"text\" id=\"${textId}\">\n <slot></slot>\n </div>\n ${when(\n () => categories().length > 0,\n () => html`\n <div class=\"categories\" part=\"categories\">\n <div class=\"category-row\">\n <ore-checkbox checked disabled helper=\"${() => label('essentialNote')}\">\n ${() => label('essential')}\n </ore-checkbox>\n </div>\n ${each(\n categories,\n (category) => category.id,\n (category) => html`\n <div class=\"category-row\">\n <ore-checkbox\n checked=\"${() => draft.value[category.value.id] === true}\"\n helper=\"${() => category.value.description ?? ''}\"\n @change=\"${(event: Event) => setCategory(category.value.id, eventFieldChecked(event))}\">\n ${() => category.value.label}\n </ore-checkbox>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <div class=\"actions\" part=\"actions\">\n <ore-button size=\"sm\" variant=\"ghost\" @click=\"${reject}\">${() => label('reject')}</ore-button>\n ${when(\n () => categories().length > 0,\n () => html`<ore-button size=\"sm\" variant=\"bordered\" @click=\"${save}\">${() => label('save')}</ore-button>`,\n )}\n <ore-button color=\"primary\" size=\"sm\" @click=\"${acceptAll}\">${() => label('acceptAll')}</ore-button>\n </div>\n </div>\n `;\n },\n styles: [reducedMotionMixin, componentStyles],\n});\n"],"mappings":"mdA0DA,IAAM,EAAiB,CACrB,UAAW,aACX,UAAW,YACX,cAAe,gCACf,QAAS,eACT,OAAQ,uBACR,KAAM,cACR,EAuEa,EAAoB,oBACjC,EAA6B,EAAmB,CAC9C,MAAO,CACL,WAAY,EAAK,KAAgC,CAAC,CAAC,EACnD,QAAS,EAAK,KAA0B,CAAC,CAAC,EAC1C,aAAc,EAAK,KAAK,EAAI,EAC5B,OAAQ,EAAK,KAAqC,CAAC,CAAC,EACpD,SAAU,EAAK,MAAM,CAAC,SAAU,KAAK,CAAU,CACjD,EACA,MAAM,EAAO,CACX,IAAM,EAAO,EAAQ,EACf,EAAO,EAA+B,EACtC,EAAY,EAAS,uBAAuB,EAC5C,EAAS,EAAS,oBAAoB,EAItC,EAAQ,EAA4B,CAAC,CAAC,EAEtC,cAAwB,CAC5B,IAAM,EAAO,EAAM,QAAQ,OAAS,CAAC,EACrC,EAAM,MAAQ,OAAO,aAClB,EAAM,WAAW,OAAS,CAAC,EAAA,CAAG,IAAK,GAAa,CAAC,EAAS,GAAI,EAAK,EAAS,MAAQ,EAAI,CAAC,CAC5F,CACF,EACA,MAAY,EAAM,QAAQ,MAAO,SAAS,EAC1C,MAAY,EAAM,WAAW,MAAO,SAAS,EAC7C,UAAU,EAEV,IAAM,MAAS,GAA6C,EAAM,OAAO,QAAQ,IAAQ,EAAe,GAGpG,EAAqC,KAKnC,cAAwB,EACf,EAAK,YAAY,cAA2B,SAAS,GACzD,EAAA,CAAM,MAAM,CACvB,EAEM,OAAU,GAAuC,CACrD,EAAK,SAAU,CAAE,QAAS,CAAE,GAAG,EAAS,UAAW,EAAK,CAAE,CAAC,EACvD,EAAM,aAAa,QAAU,IAAO,EAAK,KAAK,CACpD,EAEM,cAAwB,CAC5B,OAAO,OAAO,aAAa,EAAM,WAAW,OAAS,CAAC,EAAA,CAAG,IAAK,GAAa,CAAC,EAAS,GAAI,EAAI,CAAC,CAAC,CAAC,CAClG,EAEM,WAAqB,CACzB,OAAO,OAAO,aAAa,EAAM,WAAW,OAAS,CAAC,EAAA,CAAG,IAAK,GAAa,CAAC,EAAS,GAAI,EAAK,CAAC,CAAC,CAAC,CACnG,EAEM,SAAmB,CACvB,OAAO,CAAE,GAAG,EAAM,KAAM,CAAC,CAC3B,EAEM,aAAe,EAAY,IAA2B,CAC1D,EAAM,MAAQ,CAAE,GAAG,EAAM,OAAQ,GAAK,CAAQ,CAChD,EAEA,EAAK,SAAmB,CACjB,EAAK,SACV,EAAiB,SAAS,yBAAyB,YAAc,SAAS,cAAgB,KAC1F,UAAU,EACV,EAAK,OAAS,GACd,UAAU,EACZ,EACA,EAAK,SAAmB,CACtB,EAAK,OAAS,GACd,GAAgB,MAAM,EACtB,EAAiB,IACnB,EAEA,IAAM,eAA8C,EAAM,WAAW,OAAS,CAAC,EAE/E,MAAO,EAAI;;;;;;2BAMY,EAAU;4BACT,EAAO;;iDAEc,EAAU,QAAU,MAAM,SAAS,EAAE;4CAC1C,EAAO;;;UAGzC,MACM,WAAW,CAAC,CAAC,OAAS,MACtB,CAAI;;;6DAG2C,MAAM,eAAe,EAAE;wBAC5D,MAAM,WAAW,EAAE;;;gBAG7B,EACA,WACC,GAAa,EAAS,GACtB,GAAa,CAAI;;;qCAGK,EAAM,MAAM,EAAS,MAAM,MAAQ,GAAK;oCACzC,EAAS,MAAM,aAAe,GAAG;iCACrC,GAAiB,YAAY,EAAS,MAAM,GAAI,EAAkB,CAAK,CAAC,EAAE;4BAC9E,EAAS,MAAM,MAAM;;;iBAIrC,EAAE;;WAGR,EAAE;;0DAEgD,OAAO,QAAU,MAAM,QAAQ,EAAE;YAC/E,MACM,WAAW,CAAC,CAAC,OAAS,MACtB,CAAI,oDAAoD,KAAK,QAAU,MAAM,MAAM,EAAE,cAC7F,EAAE;0DAC8C,UAAU,QAAU,MAAM,WAAW,EAAE;;;KAI/F,EACA,OAAQ,CAAC,EAAoB,CAAe,CAC9C,CAAC"}
|
package/dist/copy-command.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./styles/mixins/accessibility.css.cjs"),t=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./styles/mixins/accessibility.css.cjs"),t=require("./shared/types.cjs"),n=require("./icon.cjs"),r=require("./content/copy-command/copy-command.css.cjs");let i=require("@vielzeug/ripple"),a=require("@vielzeug/ore");var o=[`flat`,`bordered`,`ghost`],s=`ore-copy-command`;(0,a.define)(s,{props:{rounded:a.prop.oneOf(t.ROUNDED_SIZES,`md`),size:a.prop.oneOf(t.COMPONENT_SIZES,`md`),value:a.prop.string(``),variant:a.prop.oneOf(o,`flat`)},setup(e){let t=(0,a.useEmit)(),n=(0,a.useSlots)(),r=(0,i.signal)(!1),o=(0,i.signal)(!1),s=null;(0,a.onCleanup)(()=>{s!==null&&clearTimeout(s)});let handleCopy=async()=>{let n=e.value.value??``;if(n){s!==null&&clearTimeout(s);try{await navigator.clipboard.writeText(n),r.value=!0,o.value=!1,t(`copy`,{value:n})}catch{r.value=!1,o.value=!0}s=setTimeout(()=>{r.value=!1,o.value=!1,s=null},2e3)}},c=(0,i.computed)(()=>n.has(`suffix`).value),l=(0,i.computed)(()=>r.value?`Copied!`:o.value?`Copy failed: press to try again`:`Copy: ${e.value.value??``}`);return a.html`
|
|
2
2
|
<div class="wrapper" part="wrapper">
|
|
3
3
|
<button class="command" part="command" type="button" aria-label="${l}" @click=${handleCopy}>
|
|
4
4
|
<code class="command-text" part="command-text">${e.value}</code>
|
|
5
5
|
<span class="copy-icon" part="copy-icon" aria-hidden="true">
|
|
6
|
-
${()=>
|
|
6
|
+
${()=>r.value?a.html`
|
|
7
7
|
<ore-icon name="check" size="14" class="icon-copied" aria-hidden="true"></ore-icon>
|
|
8
|
-
`:o.value?
|
|
8
|
+
`:o.value?a.html`
|
|
9
9
|
<ore-icon name="circle-alert" size="14" class="icon-failed" aria-hidden="true"></ore-icon>
|
|
10
|
-
`:
|
|
10
|
+
`:a.html`
|
|
11
11
|
<ore-icon name="copy" size="14" aria-hidden="true"></ore-icon>
|
|
12
12
|
`}
|
|
13
13
|
</span>
|
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
<div role="status" class="sr-only">
|
|
20
|
-
${()=>
|
|
20
|
+
${()=>r.value?`Copied to clipboard.`:o.value?`Copy failed. Select the command text and copy it manually.`:``}
|
|
21
21
|
</div>
|
|
22
|
-
`},styles:[e.srOnlyMixin,
|
|
22
|
+
`},styles:[e.srOnlyMixin,r.default]}),exports.COPY_COMMAND_TAG=s,exports.ICON_TAG=n.ICON_TAG;
|
|
23
23
|
//# sourceMappingURL=copy-command.cjs.map
|