@joralvmel/cosmos-core 0.3.0 → 0.4.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/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +11 -3
- package/dist/catalog.js.map +1 -1
- package/dist/codegen.d.ts +6 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +207 -4
- package/dist/codegen.js.map +1 -1
- package/dist/headless/calendar.d.ts +32 -0
- package/dist/headless/calendar.d.ts.map +1 -0
- package/dist/headless/calendar.js +242 -0
- package/dist/headless/calendar.js.map +1 -0
- package/dist/headless/listbox.d.ts.map +1 -1
- package/dist/headless/listbox.js +2 -6
- package/dist/headless/listbox.js.map +1 -1
- package/dist/headless/pagination.d.ts +34 -0
- package/dist/headless/pagination.d.ts.map +1 -0
- package/dist/headless/pagination.js +92 -0
- package/dist/headless/pagination.js.map +1 -0
- package/dist/headless/radio-group.d.ts +10 -0
- package/dist/headless/radio-group.d.ts.map +1 -0
- package/dist/headless/radio-group.js +59 -0
- package/dist/headless/radio-group.js.map +1 -0
- package/dist/headless/select.d.ts +4 -0
- package/dist/headless/select.d.ts.map +1 -0
- package/dist/headless/select.js +7 -0
- package/dist/headless/select.js.map +1 -0
- package/dist/headless/size.d.ts +3 -0
- package/dist/headless/size.d.ts.map +1 -0
- package/dist/headless/size.js +7 -0
- package/dist/headless/size.js.map +1 -0
- package/dist/headless/text-field.d.ts +3 -3
- package/dist/headless/text-field.d.ts.map +1 -1
- package/dist/headless/text-field.js +2 -2
- package/dist/headless/text-field.js.map +1 -1
- package/dist/index.d.ts +1132 -77
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -1
- package/dist/index.js.map +1 -1
- package/dist/specs/badge.d.ts +65 -0
- package/dist/specs/badge.d.ts.map +1 -0
- package/dist/specs/badge.js +64 -0
- package/dist/specs/badge.js.map +1 -0
- package/dist/specs/badge.scenarios.d.ts +21 -0
- package/dist/specs/badge.scenarios.d.ts.map +1 -0
- package/dist/specs/badge.scenarios.js +35 -0
- package/dist/specs/badge.scenarios.js.map +1 -0
- package/dist/specs/calendar.d.ts +120 -0
- package/dist/specs/calendar.d.ts.map +1 -0
- package/dist/specs/calendar.js +121 -0
- package/dist/specs/calendar.js.map +1 -0
- package/dist/specs/calendar.scenarios.d.ts +39 -0
- package/dist/specs/calendar.scenarios.d.ts.map +1 -0
- package/dist/specs/calendar.scenarios.js +139 -0
- package/dist/specs/calendar.scenarios.js.map +1 -0
- package/dist/specs/checkbox.d.ts +139 -0
- package/dist/specs/checkbox.d.ts.map +1 -0
- package/dist/specs/checkbox.js +129 -0
- package/dist/specs/checkbox.js.map +1 -0
- package/dist/specs/checkbox.scenarios.d.ts +28 -0
- package/dist/specs/checkbox.scenarios.d.ts.map +1 -0
- package/dist/specs/checkbox.scenarios.js +54 -0
- package/dist/specs/checkbox.scenarios.js.map +1 -0
- package/dist/specs/dialog.d.ts +167 -0
- package/dist/specs/dialog.d.ts.map +1 -0
- package/dist/specs/dialog.js +136 -0
- package/dist/specs/dialog.js.map +1 -0
- package/dist/specs/dialog.scenarios.d.ts +42 -0
- package/dist/specs/dialog.scenarios.d.ts.map +1 -0
- package/dist/specs/dialog.scenarios.js +129 -0
- package/dist/specs/dialog.scenarios.js.map +1 -0
- package/dist/specs/icon.d.ts +11 -20
- package/dist/specs/icon.d.ts.map +1 -1
- package/dist/specs/icon.js +11 -20
- package/dist/specs/icon.js.map +1 -1
- package/dist/specs/icon.scenarios.d.ts +9 -1
- package/dist/specs/icon.scenarios.d.ts.map +1 -1
- package/dist/specs/icon.scenarios.js +70 -6
- package/dist/specs/icon.scenarios.js.map +1 -1
- package/dist/specs/listbox.d.ts +3 -8
- package/dist/specs/listbox.d.ts.map +1 -1
- package/dist/specs/listbox.js +3 -3
- package/dist/specs/listbox.js.map +1 -1
- package/dist/specs/pagination.d.ts +147 -0
- package/dist/specs/pagination.d.ts.map +1 -0
- package/dist/specs/pagination.js +122 -0
- package/dist/specs/pagination.js.map +1 -0
- package/dist/specs/pagination.scenarios.d.ts +15 -0
- package/dist/specs/pagination.scenarios.d.ts.map +1 -0
- package/dist/specs/pagination.scenarios.js +29 -0
- package/dist/specs/pagination.scenarios.js.map +1 -0
- package/dist/specs/popover.d.ts +16 -28
- package/dist/specs/popover.d.ts.map +1 -1
- package/dist/specs/popover.js +16 -28
- package/dist/specs/popover.js.map +1 -1
- package/dist/specs/popover.scenarios.d.ts +10 -4
- package/dist/specs/popover.scenarios.d.ts.map +1 -1
- package/dist/specs/popover.scenarios.js +38 -38
- package/dist/specs/popover.scenarios.js.map +1 -1
- package/dist/specs/radio-group.d.ts +154 -0
- package/dist/specs/radio-group.d.ts.map +1 -0
- package/dist/specs/radio-group.js +133 -0
- package/dist/specs/radio-group.js.map +1 -0
- package/dist/specs/radio-group.scenarios.d.ts +35 -0
- package/dist/specs/radio-group.scenarios.d.ts.map +1 -0
- package/dist/specs/radio-group.scenarios.js +67 -0
- package/dist/specs/radio-group.scenarios.js.map +1 -0
- package/dist/specs/select.d.ts +167 -0
- package/dist/specs/select.d.ts.map +1 -0
- package/dist/specs/select.js +148 -0
- package/dist/specs/select.js.map +1 -0
- package/dist/specs/select.scenarios.d.ts +37 -0
- package/dist/specs/select.scenarios.d.ts.map +1 -0
- package/dist/specs/select.scenarios.js +77 -0
- package/dist/specs/select.scenarios.js.map +1 -0
- package/dist/specs/switch.d.ts +123 -0
- package/dist/specs/switch.d.ts.map +1 -0
- package/dist/specs/switch.js +113 -0
- package/dist/specs/switch.js.map +1 -0
- package/dist/specs/switch.scenarios.d.ts +27 -0
- package/dist/specs/switch.scenarios.d.ts.map +1 -0
- package/dist/specs/switch.scenarios.js +54 -0
- package/dist/specs/switch.scenarios.js.map +1 -0
- package/dist/specs/text-field.d.ts +8 -22
- package/dist/specs/text-field.d.ts.map +1 -1
- package/dist/specs/text-field.js +8 -17
- package/dist/specs/text-field.js.map +1 -1
- package/dist/specs/text-field.scenarios.d.ts +3 -0
- package/dist/specs/text-field.scenarios.d.ts.map +1 -1
- package/dist/specs/text-field.scenarios.js +18 -0
- package/dist/specs/text-field.scenarios.js.map +1 -1
- package/dist/specs/textarea.d.ts +144 -0
- package/dist/specs/textarea.d.ts.map +1 -0
- package/dist/specs/textarea.js +134 -0
- package/dist/specs/textarea.js.map +1 -0
- package/dist/specs/textarea.scenarios.d.ts +33 -0
- package/dist/specs/textarea.scenarios.d.ts.map +1 -0
- package/dist/specs/textarea.scenarios.js +82 -0
- package/dist/specs/textarea.scenarios.js.map +1 -0
- package/llms.md +550 -21
- package/package.json +1 -1
|
@@ -3,22 +3,86 @@ export const iconScenarios = [
|
|
|
3
3
|
{
|
|
4
4
|
name: 'uses the medium decorative default',
|
|
5
5
|
props: {},
|
|
6
|
-
expected: {
|
|
6
|
+
expected: {
|
|
7
|
+
size: 'md',
|
|
8
|
+
variant: 'outline',
|
|
9
|
+
decorative: true,
|
|
10
|
+
color: 'currentColor',
|
|
11
|
+
filled: false,
|
|
12
|
+
},
|
|
7
13
|
},
|
|
8
14
|
{
|
|
9
|
-
name: '
|
|
10
|
-
props: { size: 'sm',
|
|
11
|
-
expected: {
|
|
15
|
+
name: 'becomes informative with a nonempty label',
|
|
16
|
+
props: { size: 'sm', label: 'Home' },
|
|
17
|
+
expected: {
|
|
18
|
+
size: 'sm',
|
|
19
|
+
variant: 'outline',
|
|
20
|
+
decorative: false,
|
|
21
|
+
label: 'Home',
|
|
22
|
+
color: 'currentColor',
|
|
23
|
+
filled: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'stays decorative with a blank label',
|
|
28
|
+
props: { label: ' ' },
|
|
29
|
+
expected: {
|
|
30
|
+
size: 'md',
|
|
31
|
+
variant: 'outline',
|
|
32
|
+
decorative: true,
|
|
33
|
+
color: 'currentColor',
|
|
34
|
+
filled: false,
|
|
35
|
+
},
|
|
12
36
|
},
|
|
13
37
|
{
|
|
14
38
|
name: 'supports a large decorative icon',
|
|
15
39
|
props: { size: 'lg' },
|
|
16
|
-
expected: {
|
|
40
|
+
expected: {
|
|
41
|
+
size: 'lg',
|
|
42
|
+
variant: 'outline',
|
|
43
|
+
decorative: true,
|
|
44
|
+
color: 'currentColor',
|
|
45
|
+
filled: false,
|
|
46
|
+
},
|
|
17
47
|
},
|
|
18
48
|
{
|
|
19
49
|
name: 'supports a numeric decorative size',
|
|
20
50
|
props: { size: 32 },
|
|
21
|
-
expected: {
|
|
51
|
+
expected: {
|
|
52
|
+
size: 32,
|
|
53
|
+
variant: 'outline',
|
|
54
|
+
decorative: true,
|
|
55
|
+
color: 'currentColor',
|
|
56
|
+
filled: false,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'applies an explicit color',
|
|
61
|
+
props: { color: '#ff0000' },
|
|
62
|
+
expected: { size: 'md', variant: 'outline', decorative: true, color: '#ff0000', filled: false },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'fills shapes with the inherited color in the filled variant',
|
|
66
|
+
props: { variant: 'filled' },
|
|
67
|
+
expected: {
|
|
68
|
+
size: 'md',
|
|
69
|
+
variant: 'filled',
|
|
70
|
+
decorative: true,
|
|
71
|
+
color: 'currentColor',
|
|
72
|
+
filled: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'fills an informative icon with an explicit color',
|
|
77
|
+
props: { variant: 'filled', color: '#ff0000', label: 'Favorite' },
|
|
78
|
+
expected: {
|
|
79
|
+
size: 'md',
|
|
80
|
+
variant: 'filled',
|
|
81
|
+
decorative: false,
|
|
82
|
+
label: 'Favorite',
|
|
83
|
+
color: '#ff0000',
|
|
84
|
+
filled: true,
|
|
85
|
+
},
|
|
22
86
|
},
|
|
23
87
|
];
|
|
24
88
|
export const iconScenariosFor = (platform) => iconScenarios.filter(scenario => !scenario.platforms || scenario.platforms.includes(platform));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.scenarios.js","sourceRoot":"","sources":["../../src/specs/icon.scenarios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.scenarios.js","sourceRoot":"","sources":["../../src/specs/icon.scenarios.ts"],"names":[],"mappings":"AAyBA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD;QACE,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,KAAK;SACd;KACF;IACD;QACE,IAAI,EAAE,2CAA2C;QACjD,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;QACpC,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,KAAK;SACd;KACF;IACD;QACE,IAAI,EAAE,qCAAqC;QAC3C,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QACvB,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,KAAK;SACd;KACF;IACD;QACE,IAAI,EAAE,kCAAkC;QACxC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;QACrB,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,KAAK;SACd;KACF;IACD;QACE,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACnB,QAAQ,EAAE;YACR,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,KAAK;SACd;KACF;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;KAChG;IACD;QACE,IAAI,EAAE,6DAA6D;QACnE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,IAAI;SACb;KACF;IACD;QACE,IAAI,EAAE,kDAAkD;QACxD,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;QACjE,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,IAAI;SACb;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAAE,EAAE,CACrD,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
package/dist/specs/listbox.d.ts
CHANGED
|
@@ -71,16 +71,11 @@ export declare const listboxContract: {
|
|
|
71
71
|
readonly description: "Plain composes inside a panel; outlined adds a standalone container boundary.";
|
|
72
72
|
};
|
|
73
73
|
readonly size: {
|
|
74
|
-
readonly type: "
|
|
75
|
-
readonly
|
|
76
|
-
readonly type: "enum";
|
|
77
|
-
readonly values: readonly ["sm", "md", "lg"];
|
|
78
|
-
}, {
|
|
79
|
-
readonly type: "number";
|
|
80
|
-
}];
|
|
74
|
+
readonly type: "enum";
|
|
75
|
+
readonly values: readonly ["sm", "md", "lg"];
|
|
81
76
|
readonly default: "md";
|
|
82
77
|
readonly reflect: true;
|
|
83
|
-
readonly description: "
|
|
78
|
+
readonly description: "Small, medium or large option rows. Content may grow; native touch targets remain at least 44.";
|
|
84
79
|
};
|
|
85
80
|
readonly disabled: {
|
|
86
81
|
readonly type: "boolean";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.d.ts","sourceRoot":"","sources":["../../src/specs/listbox.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,MAAM,WAAW,CAAC,IAAI,GAAG,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AACnF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;CAChC;AAED,qGAAqG;AACrG,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"listbox.d.ts","sourceRoot":"","sources":["../../src/specs/listbox.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,MAAM,WAAW,CAAC,IAAI,GAAG,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AACnF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;CAChC;AAED,qGAAqG;AACrG,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoJ1B,CAAC"}
|
package/dist/specs/listbox.js
CHANGED
|
@@ -54,11 +54,11 @@ export const listboxContract = defineContract({
|
|
|
54
54
|
description: 'Plain composes inside a panel; outlined adds a standalone container boundary.',
|
|
55
55
|
},
|
|
56
56
|
size: {
|
|
57
|
-
type: '
|
|
58
|
-
|
|
57
|
+
type: 'enum',
|
|
58
|
+
values: ['sm', 'md', 'lg'],
|
|
59
59
|
default: 'md',
|
|
60
60
|
reflect: true,
|
|
61
|
-
description: '
|
|
61
|
+
description: 'Small, medium or large option rows. Content may grow; native touch targets remain at least 44.',
|
|
62
62
|
},
|
|
63
63
|
disabled: {
|
|
64
64
|
type: 'boolean',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.js","sourceRoot":"","sources":["../../src/specs/listbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAwBhD,qGAAqG;AACrG,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,cAAc;IACnB,WAAW,EACT,+HAA+H;IACjI,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,mDAAmD;IAC5D,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,yEAAyE;SACvF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,gEAAgE;SAC9E;QACD,KAAK,EAAE;YACL,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;YAC5B,OAAO,EAAE,SAAS;YAClB,WAAW,EACT,8NAA8N;SACjO;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,8EAA8E;SAC5F;QACD,cAAc,EAAE;YACd,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE,CAAC,OAAO,EAAE,OAA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AAM,EAAE,kFAAkF;SAC3F;QACD;YACE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;YACxB,MAAM,EACJ,0FAA0F;SAC7F;QACD;YACE,IAAI,EAAE,CAAC,sBAAsB,CAAC;YAC9B,MAAM,EAAE,kFAAkF;SAC3F;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/** Proposed one-based page. */
|
|
2
|
+
export interface PaginationChangeDetail {
|
|
3
|
+
page: number;
|
|
4
|
+
}
|
|
5
|
+
/** A bounded button-based navigation landmark for a known number of pages. */
|
|
6
|
+
export declare const paginationContract: {
|
|
7
|
+
readonly name: "pagination";
|
|
8
|
+
readonly tag: "cosm-pagination";
|
|
9
|
+
readonly description: "Navigates a known number of pages using buttons.";
|
|
10
|
+
readonly role: "navigation";
|
|
11
|
+
readonly pattern: "https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/";
|
|
12
|
+
readonly props: {
|
|
13
|
+
readonly totalPages: {
|
|
14
|
+
readonly type: "number";
|
|
15
|
+
readonly required: true;
|
|
16
|
+
readonly description: "Required nonnegative safe integer page count.";
|
|
17
|
+
};
|
|
18
|
+
readonly page: {
|
|
19
|
+
readonly type: "number";
|
|
20
|
+
readonly description: "Controlled one-based safe integer page; out-of-range values are displayed clamped.";
|
|
21
|
+
};
|
|
22
|
+
readonly defaultPage: {
|
|
23
|
+
readonly type: "number";
|
|
24
|
+
readonly default: 1;
|
|
25
|
+
readonly description: "Initial one-based page for autonomous state.";
|
|
26
|
+
};
|
|
27
|
+
readonly label: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly required: true;
|
|
30
|
+
readonly description: "Required localized navigation landmark label.";
|
|
31
|
+
};
|
|
32
|
+
readonly previousLabel: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly default: "Previous page";
|
|
35
|
+
readonly description: "Previous button label.";
|
|
36
|
+
};
|
|
37
|
+
readonly nextLabel: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly default: "Next page";
|
|
40
|
+
readonly description: "Next button label.";
|
|
41
|
+
};
|
|
42
|
+
readonly firstLabel: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly default: "First page";
|
|
45
|
+
readonly description: "First button label.";
|
|
46
|
+
};
|
|
47
|
+
readonly lastLabel: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly default: "Last page";
|
|
50
|
+
readonly description: "Last button label.";
|
|
51
|
+
};
|
|
52
|
+
readonly pageLabel: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly default: "Page {page}";
|
|
55
|
+
readonly description: "Page button label template; {page} is replaced with the localized number.";
|
|
56
|
+
};
|
|
57
|
+
readonly summaryLabel: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly default: "Page {page} of {total}";
|
|
60
|
+
readonly description: "Compact summary template with {page} and {total} placeholders.";
|
|
61
|
+
};
|
|
62
|
+
readonly locale: {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
readonly description: "Locale for formatted page numbers.";
|
|
65
|
+
};
|
|
66
|
+
readonly direction: {
|
|
67
|
+
readonly type: "enum";
|
|
68
|
+
readonly values: readonly ["ltr", "rtl"];
|
|
69
|
+
readonly default: "ltr";
|
|
70
|
+
readonly description: "Layout and directional icon direction.";
|
|
71
|
+
};
|
|
72
|
+
readonly presentation: {
|
|
73
|
+
readonly type: "enum";
|
|
74
|
+
readonly values: readonly ["numbered", "compact"];
|
|
75
|
+
readonly default: "numbered";
|
|
76
|
+
readonly reflect: true;
|
|
77
|
+
readonly description: "Show up to seven fixed-width numbered positions or a compact summary.";
|
|
78
|
+
};
|
|
79
|
+
readonly variant: {
|
|
80
|
+
readonly type: "enum";
|
|
81
|
+
readonly values: readonly ["solid", "soft", "outline"];
|
|
82
|
+
readonly default: "solid";
|
|
83
|
+
readonly reflect: true;
|
|
84
|
+
readonly description: "Selected page emphasis.";
|
|
85
|
+
};
|
|
86
|
+
readonly size: {
|
|
87
|
+
readonly type: "enum";
|
|
88
|
+
readonly values: readonly ["sm", "md", "lg"];
|
|
89
|
+
readonly default: "md";
|
|
90
|
+
readonly reflect: true;
|
|
91
|
+
readonly description: "Control size.";
|
|
92
|
+
};
|
|
93
|
+
readonly showFirstLast: {
|
|
94
|
+
readonly type: "boolean";
|
|
95
|
+
readonly default: false;
|
|
96
|
+
readonly description: "Show first and last page controls.";
|
|
97
|
+
};
|
|
98
|
+
readonly disabled: {
|
|
99
|
+
readonly type: "boolean";
|
|
100
|
+
readonly default: false;
|
|
101
|
+
readonly reflect: true;
|
|
102
|
+
readonly description: "Disable all controls.";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
readonly events: {
|
|
106
|
+
readonly change: {
|
|
107
|
+
readonly description: "Proposes a different page after enabled user activation.";
|
|
108
|
+
readonly detail: "PaginationChangeDetail";
|
|
109
|
+
readonly names: {
|
|
110
|
+
readonly dom: "cosm-change";
|
|
111
|
+
readonly react: "onChange";
|
|
112
|
+
readonly angular: "pageChange";
|
|
113
|
+
readonly native: "onPageChange";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly states: readonly [{
|
|
118
|
+
readonly prop: "page";
|
|
119
|
+
readonly event: "change";
|
|
120
|
+
readonly defaultProp: "defaultPage";
|
|
121
|
+
}];
|
|
122
|
+
readonly slots: {};
|
|
123
|
+
readonly parts: {
|
|
124
|
+
readonly base: "Navigation landmark.";
|
|
125
|
+
readonly control: "Navigation control.";
|
|
126
|
+
readonly page: "Page control.";
|
|
127
|
+
readonly current: "Current page control.";
|
|
128
|
+
readonly ellipsis: "Decorative omitted-page indicator.";
|
|
129
|
+
readonly summary: "Compact summary.";
|
|
130
|
+
};
|
|
131
|
+
readonly cssProperties: {
|
|
132
|
+
readonly '--cosm-pagination-gap': "Gap between controls.";
|
|
133
|
+
readonly '--cosm-pagination-min-height': "Minimum control height.";
|
|
134
|
+
readonly '--cosm-pagination-radius': "Control corner radius.";
|
|
135
|
+
readonly '--cosm-pagination-current-background': "Current page background.";
|
|
136
|
+
readonly '--cosm-pagination-current-color': "Current page foreground.";
|
|
137
|
+
readonly '--cosm-pagination-current-border': "Current page border color.";
|
|
138
|
+
};
|
|
139
|
+
readonly keyboard: readonly [{
|
|
140
|
+
readonly keys: readonly ["Tab", "Shift+Tab"];
|
|
141
|
+
readonly action: "Moves between enabled controls.";
|
|
142
|
+
}, {
|
|
143
|
+
readonly keys: readonly ["Enter", "Space"];
|
|
144
|
+
readonly action: "Activates the focused control.";
|
|
145
|
+
}];
|
|
146
|
+
};
|
|
147
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/specs/pagination.ts"],"names":[],"mappings":"AAEA,+BAA+B;AAC/B,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuH7B,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { defineContract } from '../contract.js';
|
|
2
|
+
/** A bounded button-based navigation landmark for a known number of pages. */
|
|
3
|
+
export const paginationContract = defineContract({
|
|
4
|
+
name: 'pagination',
|
|
5
|
+
tag: 'cosm-pagination',
|
|
6
|
+
description: 'Navigates a known number of pages using buttons.',
|
|
7
|
+
role: 'navigation',
|
|
8
|
+
pattern: 'https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/',
|
|
9
|
+
props: {
|
|
10
|
+
totalPages: {
|
|
11
|
+
type: 'number',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Required nonnegative safe integer page count.',
|
|
14
|
+
},
|
|
15
|
+
page: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
description: 'Controlled one-based safe integer page; out-of-range values are displayed clamped.',
|
|
18
|
+
},
|
|
19
|
+
defaultPage: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
default: 1,
|
|
22
|
+
description: 'Initial one-based page for autonomous state.',
|
|
23
|
+
},
|
|
24
|
+
label: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: true,
|
|
27
|
+
description: 'Required localized navigation landmark label.',
|
|
28
|
+
},
|
|
29
|
+
previousLabel: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: 'Previous page',
|
|
32
|
+
description: 'Previous button label.',
|
|
33
|
+
},
|
|
34
|
+
nextLabel: { type: 'string', default: 'Next page', description: 'Next button label.' },
|
|
35
|
+
firstLabel: { type: 'string', default: 'First page', description: 'First button label.' },
|
|
36
|
+
lastLabel: { type: 'string', default: 'Last page', description: 'Last button label.' },
|
|
37
|
+
pageLabel: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: 'Page {page}',
|
|
40
|
+
description: 'Page button label template; {page} is replaced with the localized number.',
|
|
41
|
+
},
|
|
42
|
+
summaryLabel: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: 'Page {page} of {total}',
|
|
45
|
+
description: 'Compact summary template with {page} and {total} placeholders.',
|
|
46
|
+
},
|
|
47
|
+
locale: { type: 'string', description: 'Locale for formatted page numbers.' },
|
|
48
|
+
direction: {
|
|
49
|
+
type: 'enum',
|
|
50
|
+
values: ['ltr', 'rtl'],
|
|
51
|
+
default: 'ltr',
|
|
52
|
+
description: 'Layout and directional icon direction.',
|
|
53
|
+
},
|
|
54
|
+
presentation: {
|
|
55
|
+
type: 'enum',
|
|
56
|
+
values: ['numbered', 'compact'],
|
|
57
|
+
default: 'numbered',
|
|
58
|
+
reflect: true,
|
|
59
|
+
description: 'Show up to seven fixed-width numbered positions or a compact summary.',
|
|
60
|
+
},
|
|
61
|
+
variant: {
|
|
62
|
+
type: 'enum',
|
|
63
|
+
values: ['solid', 'soft', 'outline'],
|
|
64
|
+
default: 'solid',
|
|
65
|
+
reflect: true,
|
|
66
|
+
description: 'Selected page emphasis.',
|
|
67
|
+
},
|
|
68
|
+
size: {
|
|
69
|
+
type: 'enum',
|
|
70
|
+
values: ['sm', 'md', 'lg'],
|
|
71
|
+
default: 'md',
|
|
72
|
+
reflect: true,
|
|
73
|
+
description: 'Control size.',
|
|
74
|
+
},
|
|
75
|
+
showFirstLast: {
|
|
76
|
+
type: 'boolean',
|
|
77
|
+
default: false,
|
|
78
|
+
description: 'Show first and last page controls.',
|
|
79
|
+
},
|
|
80
|
+
disabled: {
|
|
81
|
+
type: 'boolean',
|
|
82
|
+
default: false,
|
|
83
|
+
reflect: true,
|
|
84
|
+
description: 'Disable all controls.',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
events: {
|
|
88
|
+
change: {
|
|
89
|
+
description: 'Proposes a different page after enabled user activation.',
|
|
90
|
+
detail: 'PaginationChangeDetail',
|
|
91
|
+
names: {
|
|
92
|
+
dom: 'cosm-change',
|
|
93
|
+
react: 'onChange',
|
|
94
|
+
angular: 'pageChange',
|
|
95
|
+
native: 'onPageChange',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
states: [{ prop: 'page', event: 'change', defaultProp: 'defaultPage' }],
|
|
100
|
+
slots: {},
|
|
101
|
+
parts: {
|
|
102
|
+
base: 'Navigation landmark.',
|
|
103
|
+
control: 'Navigation control.',
|
|
104
|
+
page: 'Page control.',
|
|
105
|
+
current: 'Current page control.',
|
|
106
|
+
ellipsis: 'Decorative omitted-page indicator.',
|
|
107
|
+
summary: 'Compact summary.',
|
|
108
|
+
},
|
|
109
|
+
cssProperties: {
|
|
110
|
+
'--cosm-pagination-gap': 'Gap between controls.',
|
|
111
|
+
'--cosm-pagination-min-height': 'Minimum control height.',
|
|
112
|
+
'--cosm-pagination-radius': 'Control corner radius.',
|
|
113
|
+
'--cosm-pagination-current-background': 'Current page background.',
|
|
114
|
+
'--cosm-pagination-current-color': 'Current page foreground.',
|
|
115
|
+
'--cosm-pagination-current-border': 'Current page border color.',
|
|
116
|
+
},
|
|
117
|
+
keyboard: [
|
|
118
|
+
{ keys: ['Tab', 'Shift+Tab'], action: 'Moves between enabled controls.' },
|
|
119
|
+
{ keys: ['Enter', 'Space'], action: 'Activates the focused control.' },
|
|
120
|
+
],
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/specs/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOhD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;IAC/C,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,iBAAiB;IACtB,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,6DAA6D;IACtE,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+CAA+C;SAC7D;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oFAAoF;SACvF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,8CAA8C;SAC5D;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+CAA+C;SAC7D;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,wBAAwB;SACtC;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,oBAAo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E,oCAAoC;SAClD;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,uBAAuB;SACrC;KACF;IACD,MAAM,EAAE;QACN,MAAM,EAAE;YACN,WAAW,EAAE,0DAA0D;YACvE,MAAM,EAAE,wBAAwB;YAChC,KAAK,EAAE;gBACL,GAAG,EAAE,aAAa;gBAClB,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,cAAc;aACvB;SACF;KACF;IACD,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IACvE,KAAK,EAAE,EAAE;IACT,KAAK,EAAE;QACL,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,qBAAqB;QAC9B,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,uBAAuB;QAChC,QAAQ,EAAE,oCAAoC;QAC9C,OAAO,EAAE,kBAAkB;KAC5B;IACD,aAAa,EAAE;QACb,uBAAuB,EAAE,uBAAuB;QAChD,8BAA8B,EAAE,yBAAyB;QACzD,0BAA0B,EAAE,wBAAwB;QACpD,sCAAsC,EAAE,0BAA0B;QAClE,iCAAiC,EAAE,0BAA0B;QAC7D,kCAAkC,EAAE,4BAA4B;KACjE;IACD,QAAQ,EAAE;QACR,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,iCAAiC,EAAE;QACzE,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,gCAAgC,EAAE;KACvE;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ContractProps, Platform } from '../contract.js';
|
|
2
|
+
import type { paginationContract } from './pagination.js';
|
|
3
|
+
export interface PaginationScenario {
|
|
4
|
+
name: string;
|
|
5
|
+
props: ContractProps<typeof paginationContract, 'web'>;
|
|
6
|
+
target: number;
|
|
7
|
+
expected: {
|
|
8
|
+
page: number;
|
|
9
|
+
changes: number[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** State ownership and disabled activation shared by all platform drivers. */
|
|
13
|
+
export declare const paginationScenarios: readonly PaginationScenario[];
|
|
14
|
+
export declare const paginationScenariosFor: (_platform: Platform) => readonly PaginationScenario[];
|
|
15
|
+
//# sourceMappingURL=pagination.scenarios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.scenarios.d.ts","sourceRoot":"","sources":["../../src/specs/pagination.scenarios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC,OAAO,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC/C;AAED,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,EAAE,SAAS,kBAAkB,EAyB5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAW,QAAQ,kCAAwB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** State ownership and disabled activation shared by all platform drivers. */
|
|
2
|
+
export const paginationScenarios = [
|
|
3
|
+
{
|
|
4
|
+
name: 'commits autonomous selection',
|
|
5
|
+
props: { totalPages: 10, label: 'Results', defaultPage: 5 },
|
|
6
|
+
target: 6,
|
|
7
|
+
expected: { page: 6, changes: [6] },
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: 'proposes controlled selection without committing',
|
|
11
|
+
props: { totalPages: 10, label: 'Results', page: 5 },
|
|
12
|
+
target: 6,
|
|
13
|
+
expected: { page: 5, changes: [6] },
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'ignores the current page',
|
|
17
|
+
props: { totalPages: 10, label: 'Results', defaultPage: 5 },
|
|
18
|
+
target: 5,
|
|
19
|
+
expected: { page: 5, changes: [] },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'ignores disabled selection',
|
|
23
|
+
props: { totalPages: 10, label: 'Results', defaultPage: 5, disabled: true },
|
|
24
|
+
target: 6,
|
|
25
|
+
expected: { page: 5, changes: [] },
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
export const paginationScenariosFor = (_platform) => paginationScenarios;
|
|
29
|
+
//# sourceMappingURL=pagination.scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.scenarios.js","sourceRoot":"","sources":["../../src/specs/pagination.scenarios.ts"],"names":[],"mappings":"AAUA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAkC;IAChE;QACE,IAAI,EAAE,8BAA8B;QACpC,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE;QAC3D,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;KACpC;IACD;QACE,IAAI,EAAE,kDAAkD;QACxD,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE;QACpD,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;KACpC;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE;QAC3D,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;KACnC;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3E,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC"}
|
package/dist/specs/popover.d.ts
CHANGED
|
@@ -68,9 +68,22 @@ export interface PopoverHandle {
|
|
|
68
68
|
* remains inside. Escape/close-button dismissal suppresses reopening until pointer and focus
|
|
69
69
|
* leave. Android/iOS use press activation. No tooltip semantics are inferred.
|
|
70
70
|
* The optional close control uses IconButton and an individual Lucide X (ADR 0005).
|
|
71
|
+
*
|
|
72
|
+
* Positioning is not configurable beyond side and align: the panel sits at the theme space-sm
|
|
73
|
+
* distance (8 CSS pixels/logical units by default) from the trigger, measured to the arrow tip
|
|
74
|
+
* when shown. When the requested side overflows the viewport/safe area, the opposite side is
|
|
75
|
+
* used only if it reduces main-axis overflow (ties keep the requested side); the panel is then
|
|
76
|
+
* shifted and constrained within the available bounds. Collision handling takes priority over
|
|
77
|
+
* the distance. Recompute for trigger/panel size, viewport/safe-area, scrolling and orientation.
|
|
78
|
+
*
|
|
79
|
+
* Focus policy is fixed: opening never moves focus (it stays on the trigger; users reach the
|
|
80
|
+
* content with Tab or screen-reader navigation, or the consumer focuses its own content).
|
|
81
|
+
* After committed trigger, Escape, action, close-button or Back closure, focus returns to the
|
|
82
|
+
* trigger only if it was inside the panel and the trigger is connected and focusable. Never
|
|
83
|
+
* steal outside focus, restore after an outside press, or restore for unsolicited prop closure.
|
|
84
|
+
*
|
|
71
85
|
* Arrow follows the actual side and trigger center, hiding when corners or collisions prevent
|
|
72
|
-
* a correct pointer.
|
|
73
|
-
* No animation, named sizes or tones are added.
|
|
86
|
+
* a correct pointer. No animation, named sizes or tones are added.
|
|
74
87
|
*/
|
|
75
88
|
export declare const popoverContract: {
|
|
76
89
|
readonly name: "popover";
|
|
@@ -106,11 +119,6 @@ export declare const popoverContract: {
|
|
|
106
119
|
readonly default: "Close";
|
|
107
120
|
readonly description: "Localized accessible name of the close button. Must be non-empty when closable is true.";
|
|
108
121
|
};
|
|
109
|
-
readonly gap: {
|
|
110
|
-
readonly type: "number";
|
|
111
|
-
readonly default: 8;
|
|
112
|
-
readonly description: "Non-negative finite distance from trigger to panel, or to the arrow tip. CSS pixels on web, logical units on native. Viewport/safe-area collision handling takes priority.";
|
|
113
|
-
};
|
|
114
122
|
readonly arrow: {
|
|
115
123
|
readonly type: "boolean";
|
|
116
124
|
readonly default: false;
|
|
@@ -126,22 +134,12 @@ export declare const popoverContract: {
|
|
|
126
134
|
readonly default: true;
|
|
127
135
|
readonly description: "Requests closure on an outside press without preventing its interaction or restoring trigger focus.";
|
|
128
136
|
};
|
|
129
|
-
readonly initialFocus: {
|
|
130
|
-
readonly type: "boolean";
|
|
131
|
-
readonly default: false;
|
|
132
|
-
readonly description: "On committed opening (including initially open), focus the first focusable panel descendant, falling back to the panel without adding semantics. False leaves focus unchanged. Native moves accessible/input focus where supported.";
|
|
133
|
-
};
|
|
134
|
-
readonly restoreFocus: {
|
|
135
|
-
readonly type: "boolean";
|
|
136
|
-
readonly default: true;
|
|
137
|
-
readonly description: "After committed trigger, Escape, action or Back closure, restore focus only if still inside the panel and the trigger is connected and focusable. Never steal outside focus, restore after outside press, or restore for unsolicited prop closure.";
|
|
138
|
-
};
|
|
139
137
|
readonly side: {
|
|
140
138
|
readonly type: "enum";
|
|
141
139
|
readonly values: readonly ["top", "right", "bottom", "left"];
|
|
142
140
|
readonly default: "bottom";
|
|
143
141
|
readonly reflect: true;
|
|
144
|
-
readonly description: "Requested physical side; actual placement
|
|
142
|
+
readonly description: "Requested physical side; actual placement flips to the opposite side when that reduces viewport/safe-area overflow, then shifts within bounds.";
|
|
145
143
|
};
|
|
146
144
|
readonly align: {
|
|
147
145
|
readonly type: "enum";
|
|
@@ -150,16 +148,6 @@ export declare const popoverContract: {
|
|
|
150
148
|
readonly reflect: true;
|
|
151
149
|
readonly description: "Cross-axis alignment. On top/bottom, start/end follow inline direction (RTL reverses them); on left/right they mean top/bottom.";
|
|
152
150
|
};
|
|
153
|
-
readonly flip: {
|
|
154
|
-
readonly type: "boolean";
|
|
155
|
-
readonly default: true;
|
|
156
|
-
readonly description: "Try the opposite side when the requested side overflows the available viewport/safe area; flip only if it reduces main-axis overflow. Ties keep the requested side. Runs before shift.";
|
|
157
|
-
};
|
|
158
|
-
readonly shift: {
|
|
159
|
-
readonly type: "boolean";
|
|
160
|
-
readonly default: true;
|
|
161
|
-
readonly description: "After flip, translate within available viewport/safe-area bounds to reduce overflow. Constrain oversized panels to that region regardless of collision flags; flags never change requested props.";
|
|
162
|
-
};
|
|
163
151
|
};
|
|
164
152
|
readonly events: {
|
|
165
153
|
readonly openChange: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/specs/popover.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,MAAM,GACN,cAAc,GACd,OAAO,GACP,OAAO,CAAC;AAEZ;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO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