@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.
Files changed (140) hide show
  1. package/dist/catalog.d.ts.map +1 -1
  2. package/dist/catalog.js +11 -3
  3. package/dist/catalog.js.map +1 -1
  4. package/dist/codegen.d.ts +6 -0
  5. package/dist/codegen.d.ts.map +1 -1
  6. package/dist/codegen.js +207 -4
  7. package/dist/codegen.js.map +1 -1
  8. package/dist/headless/calendar.d.ts +32 -0
  9. package/dist/headless/calendar.d.ts.map +1 -0
  10. package/dist/headless/calendar.js +242 -0
  11. package/dist/headless/calendar.js.map +1 -0
  12. package/dist/headless/listbox.d.ts.map +1 -1
  13. package/dist/headless/listbox.js +2 -6
  14. package/dist/headless/listbox.js.map +1 -1
  15. package/dist/headless/pagination.d.ts +34 -0
  16. package/dist/headless/pagination.d.ts.map +1 -0
  17. package/dist/headless/pagination.js +92 -0
  18. package/dist/headless/pagination.js.map +1 -0
  19. package/dist/headless/radio-group.d.ts +10 -0
  20. package/dist/headless/radio-group.d.ts.map +1 -0
  21. package/dist/headless/radio-group.js +59 -0
  22. package/dist/headless/radio-group.js.map +1 -0
  23. package/dist/headless/select.d.ts +4 -0
  24. package/dist/headless/select.d.ts.map +1 -0
  25. package/dist/headless/select.js +7 -0
  26. package/dist/headless/select.js.map +1 -0
  27. package/dist/headless/size.d.ts +3 -0
  28. package/dist/headless/size.d.ts.map +1 -0
  29. package/dist/headless/size.js +7 -0
  30. package/dist/headless/size.js.map +1 -0
  31. package/dist/headless/text-field.d.ts +3 -3
  32. package/dist/headless/text-field.d.ts.map +1 -1
  33. package/dist/headless/text-field.js +2 -2
  34. package/dist/headless/text-field.js.map +1 -1
  35. package/dist/index.d.ts +1132 -77
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +42 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/specs/badge.d.ts +65 -0
  40. package/dist/specs/badge.d.ts.map +1 -0
  41. package/dist/specs/badge.js +64 -0
  42. package/dist/specs/badge.js.map +1 -0
  43. package/dist/specs/badge.scenarios.d.ts +21 -0
  44. package/dist/specs/badge.scenarios.d.ts.map +1 -0
  45. package/dist/specs/badge.scenarios.js +35 -0
  46. package/dist/specs/badge.scenarios.js.map +1 -0
  47. package/dist/specs/calendar.d.ts +120 -0
  48. package/dist/specs/calendar.d.ts.map +1 -0
  49. package/dist/specs/calendar.js +121 -0
  50. package/dist/specs/calendar.js.map +1 -0
  51. package/dist/specs/calendar.scenarios.d.ts +39 -0
  52. package/dist/specs/calendar.scenarios.d.ts.map +1 -0
  53. package/dist/specs/calendar.scenarios.js +139 -0
  54. package/dist/specs/calendar.scenarios.js.map +1 -0
  55. package/dist/specs/checkbox.d.ts +139 -0
  56. package/dist/specs/checkbox.d.ts.map +1 -0
  57. package/dist/specs/checkbox.js +129 -0
  58. package/dist/specs/checkbox.js.map +1 -0
  59. package/dist/specs/checkbox.scenarios.d.ts +28 -0
  60. package/dist/specs/checkbox.scenarios.d.ts.map +1 -0
  61. package/dist/specs/checkbox.scenarios.js +54 -0
  62. package/dist/specs/checkbox.scenarios.js.map +1 -0
  63. package/dist/specs/dialog.d.ts +167 -0
  64. package/dist/specs/dialog.d.ts.map +1 -0
  65. package/dist/specs/dialog.js +136 -0
  66. package/dist/specs/dialog.js.map +1 -0
  67. package/dist/specs/dialog.scenarios.d.ts +42 -0
  68. package/dist/specs/dialog.scenarios.d.ts.map +1 -0
  69. package/dist/specs/dialog.scenarios.js +129 -0
  70. package/dist/specs/dialog.scenarios.js.map +1 -0
  71. package/dist/specs/icon.d.ts +11 -20
  72. package/dist/specs/icon.d.ts.map +1 -1
  73. package/dist/specs/icon.js +11 -20
  74. package/dist/specs/icon.js.map +1 -1
  75. package/dist/specs/icon.scenarios.d.ts +9 -1
  76. package/dist/specs/icon.scenarios.d.ts.map +1 -1
  77. package/dist/specs/icon.scenarios.js +70 -6
  78. package/dist/specs/icon.scenarios.js.map +1 -1
  79. package/dist/specs/listbox.d.ts +3 -8
  80. package/dist/specs/listbox.d.ts.map +1 -1
  81. package/dist/specs/listbox.js +3 -3
  82. package/dist/specs/listbox.js.map +1 -1
  83. package/dist/specs/pagination.d.ts +147 -0
  84. package/dist/specs/pagination.d.ts.map +1 -0
  85. package/dist/specs/pagination.js +122 -0
  86. package/dist/specs/pagination.js.map +1 -0
  87. package/dist/specs/pagination.scenarios.d.ts +15 -0
  88. package/dist/specs/pagination.scenarios.d.ts.map +1 -0
  89. package/dist/specs/pagination.scenarios.js +29 -0
  90. package/dist/specs/pagination.scenarios.js.map +1 -0
  91. package/dist/specs/popover.d.ts +16 -28
  92. package/dist/specs/popover.d.ts.map +1 -1
  93. package/dist/specs/popover.js +16 -28
  94. package/dist/specs/popover.js.map +1 -1
  95. package/dist/specs/popover.scenarios.d.ts +10 -4
  96. package/dist/specs/popover.scenarios.d.ts.map +1 -1
  97. package/dist/specs/popover.scenarios.js +38 -38
  98. package/dist/specs/popover.scenarios.js.map +1 -1
  99. package/dist/specs/radio-group.d.ts +154 -0
  100. package/dist/specs/radio-group.d.ts.map +1 -0
  101. package/dist/specs/radio-group.js +133 -0
  102. package/dist/specs/radio-group.js.map +1 -0
  103. package/dist/specs/radio-group.scenarios.d.ts +35 -0
  104. package/dist/specs/radio-group.scenarios.d.ts.map +1 -0
  105. package/dist/specs/radio-group.scenarios.js +67 -0
  106. package/dist/specs/radio-group.scenarios.js.map +1 -0
  107. package/dist/specs/select.d.ts +167 -0
  108. package/dist/specs/select.d.ts.map +1 -0
  109. package/dist/specs/select.js +148 -0
  110. package/dist/specs/select.js.map +1 -0
  111. package/dist/specs/select.scenarios.d.ts +37 -0
  112. package/dist/specs/select.scenarios.d.ts.map +1 -0
  113. package/dist/specs/select.scenarios.js +77 -0
  114. package/dist/specs/select.scenarios.js.map +1 -0
  115. package/dist/specs/switch.d.ts +123 -0
  116. package/dist/specs/switch.d.ts.map +1 -0
  117. package/dist/specs/switch.js +113 -0
  118. package/dist/specs/switch.js.map +1 -0
  119. package/dist/specs/switch.scenarios.d.ts +27 -0
  120. package/dist/specs/switch.scenarios.d.ts.map +1 -0
  121. package/dist/specs/switch.scenarios.js +54 -0
  122. package/dist/specs/switch.scenarios.js.map +1 -0
  123. package/dist/specs/text-field.d.ts +8 -22
  124. package/dist/specs/text-field.d.ts.map +1 -1
  125. package/dist/specs/text-field.js +8 -17
  126. package/dist/specs/text-field.js.map +1 -1
  127. package/dist/specs/text-field.scenarios.d.ts +3 -0
  128. package/dist/specs/text-field.scenarios.d.ts.map +1 -1
  129. package/dist/specs/text-field.scenarios.js +18 -0
  130. package/dist/specs/text-field.scenarios.js.map +1 -1
  131. package/dist/specs/textarea.d.ts +144 -0
  132. package/dist/specs/textarea.d.ts.map +1 -0
  133. package/dist/specs/textarea.js +134 -0
  134. package/dist/specs/textarea.js.map +1 -0
  135. package/dist/specs/textarea.scenarios.d.ts +33 -0
  136. package/dist/specs/textarea.scenarios.d.ts.map +1 -0
  137. package/dist/specs/textarea.scenarios.js +82 -0
  138. package/dist/specs/textarea.scenarios.js.map +1 -0
  139. package/llms.md +550 -21
  140. package/package.json +1 -1
@@ -0,0 +1,77 @@
1
+ export const selectScenarioItems = [
2
+ { value: 'apple', label: 'Apple' },
3
+ { value: 'cherry', label: 'Cherry' },
4
+ { value: 'lime', label: 'Lime', disabled: true },
5
+ ];
6
+ const baseProps = {
7
+ label: 'Fruit',
8
+ items: selectScenarioItems,
9
+ placeholder: 'Choose a fruit',
10
+ };
11
+ export const selectScenarios = [
12
+ {
13
+ name: 'starts without a selection',
14
+ props: baseProps,
15
+ actions: [],
16
+ expected: { value: null, changes: [] },
17
+ },
18
+ {
19
+ name: 'supports the filled variant',
20
+ props: { ...baseProps, variant: 'filled' },
21
+ actions: [],
22
+ expected: { value: null, changes: [] },
23
+ },
24
+ {
25
+ name: 'initializes autonomous selection from defaultValue',
26
+ props: { ...baseProps, defaultValue: 'apple' },
27
+ actions: [],
28
+ expected: { value: 'apple', changes: [] },
29
+ },
30
+ {
31
+ name: 'commits autonomous selection and emits its proposal',
32
+ props: baseProps,
33
+ actions: [{ type: 'select', value: 'cherry' }],
34
+ expected: { value: 'cherry', changes: ['cherry'] },
35
+ },
36
+ {
37
+ name: 'controlled selection waits for the owner',
38
+ props: { ...baseProps, value: 'apple' },
39
+ actions: [{ type: 'select', value: 'cherry' }],
40
+ expected: { value: 'apple', changes: ['cherry'] },
41
+ },
42
+ {
43
+ name: 'controlled null remains unselected until the owner accepts',
44
+ props: { ...baseProps, value: null },
45
+ actions: [{ type: 'select', value: 'apple' }],
46
+ expected: { value: null, changes: ['apple'] },
47
+ },
48
+ {
49
+ name: 'controlled selection commits after the owner updates',
50
+ props: { ...baseProps, value: 'apple' },
51
+ actions: [
52
+ { type: 'select', value: 'cherry' },
53
+ { type: 'set-value', value: 'cherry' },
54
+ ],
55
+ expected: { value: 'cherry', changes: ['cherry'] },
56
+ },
57
+ {
58
+ name: 'does not emit when the selected option is activated',
59
+ props: { ...baseProps, defaultValue: 'apple' },
60
+ actions: [{ type: 'select', value: 'apple' }],
61
+ expected: { value: 'apple', changes: [] },
62
+ },
63
+ {
64
+ name: 'does not select a disabled option',
65
+ props: baseProps,
66
+ actions: [{ type: 'select', value: 'lime' }],
67
+ expected: { value: null, changes: [] },
68
+ },
69
+ {
70
+ name: 'does not select an option when the control is disabled',
71
+ props: { ...baseProps, disabled: true },
72
+ actions: [{ type: 'select', value: 'apple' }],
73
+ expected: { value: null, changes: [] },
74
+ },
75
+ ];
76
+ export const selectScenariosFor = (platform) => selectScenarios.filter(scenario => !scenario.platforms || scenario.platforms.includes(platform));
77
+ //# sourceMappingURL=select.scenarios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.scenarios.js","sourceRoot":"","sources":["../../src/specs/select.scenarios.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC9C,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EA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EAAE,OAAO,EAAE,EAAE,EAAE;KACvC;IACD;QACE,IAAI,EAAE,wDAAwD;QAC9D,KAAK,EAAE,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;QACvC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC7C,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAE,EAAE,CACvD,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,123 @@
1
+ /** A proposed checked value after the switch is activated. */
2
+ export interface SwitchCheckedChangeDetail {
3
+ checked: boolean;
4
+ }
5
+ /**
6
+ * An immediate binary setting with autonomous or controlled checked state.
7
+ *
8
+ * | State | Autonomous | Controlled | Event |
9
+ * | --- | --- | --- | --- |
10
+ * | checked | Starts at defaultChecked and commits activation | A supplied checked, including false, waits for the owner | checkedChange |
11
+ */
12
+ export declare const switchContract: {
13
+ readonly name: "switch";
14
+ readonly tag: "cosm-switch";
15
+ readonly description: "Toggles a binary setting immediately with a stable accessible name and form behavior on the web.";
16
+ readonly role: "switch";
17
+ readonly pattern: "https://www.w3.org/WAI/ARIA/apg/patterns/switch/";
18
+ readonly props: {
19
+ readonly label: {
20
+ readonly type: "string";
21
+ readonly required: true;
22
+ readonly description: "Required nonempty accessible name; remains stable in both states.";
23
+ };
24
+ readonly labelHidden: {
25
+ readonly type: "boolean";
26
+ readonly default: false;
27
+ readonly reflect: true;
28
+ readonly description: "Visually hides the label while retaining its accessible name.";
29
+ };
30
+ readonly checked: {
31
+ readonly type: "boolean";
32
+ readonly default: false;
33
+ readonly description: "Controlled checked value when supplied, including false; activation proposes changes without self-committing.";
34
+ };
35
+ readonly defaultChecked: {
36
+ readonly type: "boolean";
37
+ readonly default: false;
38
+ readonly description: "Initial autonomous checked value; later changes do not reset it.";
39
+ };
40
+ readonly size: {
41
+ readonly type: "enum";
42
+ readonly values: readonly ["sm", "md", "lg"];
43
+ readonly default: "md";
44
+ readonly reflect: true;
45
+ readonly platforms: readonly ["web", "react", "angular"];
46
+ readonly description: "Small, medium or large web switch. Native uses system Switch sizing.";
47
+ };
48
+ readonly disabled: {
49
+ readonly type: "boolean";
50
+ readonly default: false;
51
+ readonly reflect: true;
52
+ readonly description: "Prevents user interaction and excludes the value from web form submission.";
53
+ };
54
+ readonly invalid: {
55
+ readonly type: "boolean";
56
+ readonly default: false;
57
+ readonly reflect: true;
58
+ readonly description: "Externally supplied invalid presentation. Does not change checked state or form validity; native uses danger colors without an equivalent system invalid trait.";
59
+ };
60
+ readonly helperText: {
61
+ readonly type: "string";
62
+ readonly description: "Optional consumer-localized supporting text associated with the switch.";
63
+ };
64
+ readonly name: {
65
+ readonly type: "string";
66
+ readonly reflect: true;
67
+ readonly platforms: readonly ["web", "react", "angular"];
68
+ readonly description: "Web form field name; React Native has no HTML form association.";
69
+ };
70
+ readonly value: {
71
+ readonly type: "string";
72
+ readonly default: "on";
73
+ readonly platforms: readonly ["web", "react", "angular"];
74
+ readonly description: "Web form value submitted when checked and enabled; defaults to on. Angular Forms uses checked as its boolean value.";
75
+ };
76
+ };
77
+ readonly events: {
78
+ readonly checkedChange: {
79
+ readonly description: "Proposes the next checked value after enabled user activation; controlled state waits for the owner.";
80
+ readonly detail: "SwitchCheckedChangeDetail";
81
+ readonly names: {
82
+ readonly dom: "cosm-checked-change";
83
+ readonly react: "onCheckedChange";
84
+ readonly angular: "checkedChange";
85
+ readonly native: "onCheckedChange";
86
+ };
87
+ };
88
+ };
89
+ readonly states: readonly [{
90
+ readonly prop: "checked";
91
+ readonly event: "checkedChange";
92
+ readonly defaultProp: "defaultChecked";
93
+ }];
94
+ readonly slots: {};
95
+ readonly parts: {
96
+ readonly base: "Label, control and supporting text layout.";
97
+ readonly input: "Native checkbox input and web focus target.";
98
+ readonly track: "Visible switch track.";
99
+ readonly thumb: "Visible switch thumb.";
100
+ readonly label: "Visible or visually hidden label text.";
101
+ readonly 'help-text': "Supporting text associated with the switch.";
102
+ };
103
+ readonly cssProperties: {
104
+ readonly '--cosm-switch-width': "Track width.";
105
+ readonly '--cosm-switch-height': "Track height.";
106
+ readonly '--cosm-switch-thumb-size': "Thumb diameter.";
107
+ readonly '--cosm-switch-track-background': "Unchecked track background.";
108
+ readonly '--cosm-switch-checked-track-background': "Checked track background.";
109
+ readonly '--cosm-switch-thumb-background': "Thumb background.";
110
+ readonly '--cosm-switch-border': "Unchecked track boundary color.";
111
+ readonly '--cosm-switch-radius': "Track corner radius.";
112
+ readonly '--cosm-switch-gap': "Space between the switch and label.";
113
+ readonly '--cosm-switch-focus': "Visible keyboard focus indicator color.";
114
+ };
115
+ readonly keyboard: readonly [{
116
+ readonly keys: readonly ["Tab", "Shift+Tab"];
117
+ readonly action: "Moves focus to or from the enabled switch.";
118
+ }, {
119
+ readonly keys: readonly ["Space"];
120
+ readonly action: "Toggles checked state and emits a checkedChange proposal.";
121
+ }];
122
+ };
123
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/specs/switch.ts"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GzB,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { defineContract } from '../contract.js';
2
+ /**
3
+ * An immediate binary setting with autonomous or controlled checked state.
4
+ *
5
+ * | State | Autonomous | Controlled | Event |
6
+ * | --- | --- | --- | --- |
7
+ * | checked | Starts at defaultChecked and commits activation | A supplied checked, including false, waits for the owner | checkedChange |
8
+ */
9
+ export const switchContract = defineContract({
10
+ name: 'switch',
11
+ tag: 'cosm-switch',
12
+ description: 'Toggles a binary setting immediately with a stable accessible name and form behavior on the web.',
13
+ role: 'switch',
14
+ pattern: 'https://www.w3.org/WAI/ARIA/apg/patterns/switch/',
15
+ props: {
16
+ label: {
17
+ type: 'string',
18
+ required: true,
19
+ description: 'Required nonempty accessible name; remains stable in both states.',
20
+ },
21
+ labelHidden: {
22
+ type: 'boolean',
23
+ default: false,
24
+ reflect: true,
25
+ description: 'Visually hides the label while retaining its accessible name.',
26
+ },
27
+ checked: {
28
+ type: 'boolean',
29
+ default: false,
30
+ description: 'Controlled checked value when supplied, including false; activation proposes changes without self-committing.',
31
+ },
32
+ defaultChecked: {
33
+ type: 'boolean',
34
+ default: false,
35
+ description: 'Initial autonomous checked value; later changes do not reset it.',
36
+ },
37
+ size: {
38
+ type: 'enum',
39
+ values: ['sm', 'md', 'lg'],
40
+ default: 'md',
41
+ reflect: true,
42
+ platforms: ['web', 'react', 'angular'],
43
+ description: 'Small, medium or large web switch. Native uses system Switch sizing.',
44
+ },
45
+ disabled: {
46
+ type: 'boolean',
47
+ default: false,
48
+ reflect: true,
49
+ description: 'Prevents user interaction and excludes the value from web form submission.',
50
+ },
51
+ invalid: {
52
+ type: 'boolean',
53
+ default: false,
54
+ reflect: true,
55
+ description: 'Externally supplied invalid presentation. Does not change checked state or form validity; native uses danger colors without an equivalent system invalid trait.',
56
+ },
57
+ helperText: {
58
+ type: 'string',
59
+ description: 'Optional consumer-localized supporting text associated with the switch.',
60
+ },
61
+ name: {
62
+ type: 'string',
63
+ reflect: true,
64
+ platforms: ['web', 'react', 'angular'],
65
+ description: 'Web form field name; React Native has no HTML form association.',
66
+ },
67
+ value: {
68
+ type: 'string',
69
+ default: 'on',
70
+ platforms: ['web', 'react', 'angular'],
71
+ description: 'Web form value submitted when checked and enabled; defaults to on. Angular Forms uses checked as its boolean value.',
72
+ },
73
+ },
74
+ events: {
75
+ checkedChange: {
76
+ description: 'Proposes the next checked value after enabled user activation; controlled state waits for the owner.',
77
+ detail: 'SwitchCheckedChangeDetail',
78
+ names: {
79
+ dom: 'cosm-checked-change',
80
+ react: 'onCheckedChange',
81
+ angular: 'checkedChange',
82
+ native: 'onCheckedChange',
83
+ },
84
+ },
85
+ },
86
+ states: [{ prop: 'checked', event: 'checkedChange', defaultProp: 'defaultChecked' }],
87
+ slots: {},
88
+ parts: {
89
+ base: 'Label, control and supporting text layout.',
90
+ input: 'Native checkbox input and web focus target.',
91
+ track: 'Visible switch track.',
92
+ thumb: 'Visible switch thumb.',
93
+ label: 'Visible or visually hidden label text.',
94
+ 'help-text': 'Supporting text associated with the switch.',
95
+ },
96
+ cssProperties: {
97
+ '--cosm-switch-width': 'Track width.',
98
+ '--cosm-switch-height': 'Track height.',
99
+ '--cosm-switch-thumb-size': 'Thumb diameter.',
100
+ '--cosm-switch-track-background': 'Unchecked track background.',
101
+ '--cosm-switch-checked-track-background': 'Checked track background.',
102
+ '--cosm-switch-thumb-background': 'Thumb background.',
103
+ '--cosm-switch-border': 'Unchecked track boundary color.',
104
+ '--cosm-switch-radius': 'Track corner radius.',
105
+ '--cosm-switch-gap': 'Space between the switch and label.',
106
+ '--cosm-switch-focus': 'Visible keyboard focus indicator color.',
107
+ },
108
+ keyboard: [
109
+ { keys: ['Tab', 'Shift+Tab'], action: 'Moves focus to or from the enabled switch.' },
110
+ { keys: ['Space'], action: 'Toggles checked state and emits a checkedChange proposal.' },
111
+ ],
112
+ });
113
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/specs/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBA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EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,2DAA2D,EAAE;KACzF;CACF,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { Platform } from '../contract.js';
2
+ export type SwitchAction = {
3
+ type: 'activate';
4
+ } | {
5
+ type: 'sync';
6
+ checked: boolean;
7
+ };
8
+ export interface SwitchScenario {
9
+ name: string;
10
+ props: {
11
+ label: string;
12
+ checked?: boolean;
13
+ defaultChecked?: boolean;
14
+ disabled?: boolean;
15
+ invalid?: boolean;
16
+ };
17
+ actions: readonly SwitchAction[];
18
+ expected: {
19
+ checked: boolean;
20
+ changes: readonly boolean[];
21
+ };
22
+ platforms?: readonly Platform[];
23
+ }
24
+ /** Normative checked-state cases shared by platform drivers. */
25
+ export declare const switchScenarios: readonly SwitchScenario[];
26
+ export declare const switchScenariosFor: (platform: Platform) => SwitchScenario[];
27
+ //# sourceMappingURL=switch.scenarios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.scenarios.d.ts","sourceRoot":"","sources":["../../src/specs/switch.scenarios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAErF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;KAC7B,CAAC;IACF,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACjC;AAID,gEAAgE;AAChE,eAAO,MAAM,eAAe,EAAE,SAAS,cAAc,EAiDpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,QAAQ,qBAC6C,CAAC"}
@@ -0,0 +1,54 @@
1
+ const fixture = { label: 'Enable notifications' };
2
+ /** Normative checked-state cases shared by platform drivers. */
3
+ export const switchScenarios = [
4
+ {
5
+ name: 'starts unchecked without a proposal',
6
+ props: fixture,
7
+ actions: [],
8
+ expected: { checked: false, changes: [] },
9
+ },
10
+ {
11
+ name: 'defaultChecked initializes autonomous state',
12
+ props: { ...fixture, defaultChecked: true },
13
+ actions: [],
14
+ expected: { checked: true, changes: [] },
15
+ },
16
+ {
17
+ name: 'autonomous activation toggles and proposes each next value',
18
+ props: fixture,
19
+ actions: [{ type: 'activate' }, { type: 'activate' }],
20
+ expected: { checked: false, changes: [true, false] },
21
+ },
22
+ {
23
+ name: 'disabled prevents activation and proposals',
24
+ props: { ...fixture, disabled: true, defaultChecked: true },
25
+ actions: [{ type: 'activate' }],
26
+ expected: { checked: true, changes: [] },
27
+ },
28
+ {
29
+ name: 'a controlled false value refuses proposals without self-committing',
30
+ props: { ...fixture, checked: false },
31
+ actions: [{ type: 'activate' }, { type: 'activate' }],
32
+ expected: { checked: false, changes: [true, true] },
33
+ },
34
+ {
35
+ name: 'invalid presentation does not block autonomous activation',
36
+ props: { ...fixture, invalid: true },
37
+ actions: [{ type: 'activate' }],
38
+ expected: { checked: true, changes: [true] },
39
+ },
40
+ {
41
+ name: 'invalid presentation preserves controlled proposal ownership',
42
+ props: { ...fixture, invalid: true, checked: false },
43
+ actions: [{ type: 'activate' }],
44
+ expected: { checked: false, changes: [true] },
45
+ },
46
+ {
47
+ name: 'controlled state follows the value accepted by the owner',
48
+ props: { ...fixture, checked: false },
49
+ actions: [{ type: 'activate' }, { type: 'sync', checked: true }, { type: 'activate' }],
50
+ expected: { checked: true, changes: [true, false] },
51
+ },
52
+ ];
53
+ export const switchScenariosFor = (platform) => switchScenarios.filter(scenario => !scenario.platforms || scenario.platforms.includes(platform));
54
+ //# sourceMappingURL=switch.scenarios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.scenarios.js","sourceRoot":"","sources":["../../src/specs/switch.scenarios.ts"],"names":[],"mappings":"AAqBA,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;AAElD,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD;QACE,IAAI,EAAE,qCAAqC;QAC3C,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;KAC1C;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE;QAC3C,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;KACzC;IACD;QACE,IAAI,EAAE,4DAA4D;QAClE,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QACrD,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;KACrD;IACD;QACE,IAAI,EAAE,4CAA4C;QAClD,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;QAC3D,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC/B,QAAQ,EAAE,EAAE,OAAO,EAAE,IA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F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAE,EAAE,CACvD,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC"}
@@ -13,7 +13,7 @@ export interface TextFieldSubmitDetail {
13
13
  export declare const textFieldContract: {
14
14
  readonly name: "text-field";
15
15
  readonly tag: "cosm-text-field";
16
- readonly description: "Accepts a single line of text with an accessible label, optional help and error text, and native form validation on the web.";
16
+ readonly description: "Accepts a single line of text with an accessible label, optional helper and error text, and native form validation on the web.";
17
17
  readonly role: "textbox";
18
18
  readonly pattern: "https://html.spec.whatwg.org/multipage/input.html";
19
19
  readonly props: {
@@ -52,34 +52,29 @@ export declare const textFieldContract: {
52
52
  readonly description: "Visual treatment of the editable control.";
53
53
  };
54
54
  readonly size: {
55
- readonly type: "union";
56
- readonly variants: readonly [{
57
- readonly type: "enum";
58
- readonly values: readonly ["sm", "md", "lg"];
59
- }, {
60
- readonly type: "number";
61
- }];
55
+ readonly type: "enum";
56
+ readonly values: readonly ["sm", "md", "lg"];
62
57
  readonly default: "md";
63
58
  readonly reflect: true;
64
- readonly description: "Semantic size or a positive finite minimum editable-control height in CSS pixels on web and logical units on native.";
59
+ readonly description: "Small, medium or large editable control.";
65
60
  };
66
61
  readonly placeholder: {
67
62
  readonly type: "string";
68
63
  readonly description: "Short input hint; it never replaces the accessible label.";
69
64
  };
70
- readonly helpText: {
65
+ readonly helperText: {
71
66
  readonly type: "string";
72
67
  readonly description: "Optional supporting text associated with the editable control.";
73
68
  };
74
- readonly error: {
69
+ readonly errorText: {
75
70
  readonly type: "string";
76
- readonly description: "Optional externally supplied error text associated with the editable control.";
71
+ readonly description: "Optional consumer-localized error text associated with the editable control; a nonempty trimmed value also exposes invalid state.";
77
72
  };
78
73
  readonly invalid: {
79
74
  readonly type: "boolean";
80
75
  readonly default: false;
81
76
  readonly reflect: true;
82
- readonly description: "External invalid state, independent of browser constraints or consumer business validation.";
77
+ readonly description: "External invalid state when the visible error is supplied elsewhere, independent of browser constraints or consumer business validation.";
83
78
  };
84
79
  readonly required: {
85
80
  readonly type: "boolean";
@@ -144,13 +139,6 @@ export declare const textFieldContract: {
144
139
  readonly example: "search";
145
140
  readonly description: "Optional structured decorative icon after the editable text.";
146
141
  };
147
- readonly iconFocusScope: {
148
- readonly type: "enum";
149
- readonly values: readonly ["control", "input"];
150
- readonly default: "control";
151
- readonly reflect: true;
152
- readonly description: "When configured icon focus colors apply: control includes the input and clear/reveal buttons; input includes only the editable input. Does not change icons without a focus-color override.";
153
- };
154
142
  readonly prefix: {
155
143
  readonly type: "string";
156
144
  readonly description: "Optional non-interactive text decoration before the editable text.";
@@ -231,9 +219,7 @@ export declare const textFieldContract: {
231
219
  readonly '--cosm-text-field-focus': "Visible focus indicator color.";
232
220
  readonly '--cosm-text-field-radius': "Editable control corner radius.";
233
221
  readonly '--cosm-text-field-start-icon-color': "Start icon color, independent of text and affixes.";
234
- readonly '--cosm-text-field-start-icon-focus-color': "Start icon color within iconFocusScope; falls back to its normal color.";
235
222
  readonly '--cosm-text-field-end-icon-color': "End icon color, independent of text and affixes.";
236
- readonly '--cosm-text-field-end-icon-focus-color': "End icon color within iconFocusScope; falls back to its normal color.";
237
223
  };
238
224
  readonly keyboard: readonly [{
239
225
  readonly keys: readonly ["Tab", "Shift+Tab"];
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/specs/text-field.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqP5B,CAAC"}
1
+ {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/specs/text-field.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyO5B,CAAC"}
@@ -6,7 +6,7 @@ import { defineContract } from '../contract.js';
6
6
  export const textFieldContract = defineContract({
7
7
  name: 'text-field',
8
8
  tag: 'cosm-text-field',
9
- description: 'Accepts a single line of text with an accessible label, optional help and error text, and native form validation on the web.',
9
+ description: 'Accepts a single line of text with an accessible label, optional helper and error text, and native form validation on the web.',
10
10
  role: 'textbox',
11
11
  pattern: 'https://html.spec.whatwg.org/multipage/input.html',
12
12
  props: {
@@ -45,29 +45,29 @@ export const textFieldContract = defineContract({
45
45
  description: 'Visual treatment of the editable control.',
46
46
  },
47
47
  size: {
48
- type: 'union',
49
- variants: [{ type: 'enum', values: ['sm', 'md', 'lg'] }, { type: 'number' }],
48
+ type: 'enum',
49
+ values: ['sm', 'md', 'lg'],
50
50
  default: 'md',
51
51
  reflect: true,
52
- description: 'Semantic size or a positive finite minimum editable-control height in CSS pixels on web and logical units on native.',
52
+ description: 'Small, medium or large editable control.',
53
53
  },
54
54
  placeholder: {
55
55
  type: 'string',
56
56
  description: 'Short input hint; it never replaces the accessible label.',
57
57
  },
58
- helpText: {
58
+ helperText: {
59
59
  type: 'string',
60
60
  description: 'Optional supporting text associated with the editable control.',
61
61
  },
62
- error: {
62
+ errorText: {
63
63
  type: 'string',
64
- description: 'Optional externally supplied error text associated with the editable control.',
64
+ description: 'Optional consumer-localized error text associated with the editable control; a nonempty trimmed value also exposes invalid state.',
65
65
  },
66
66
  invalid: {
67
67
  type: 'boolean',
68
68
  default: false,
69
69
  reflect: true,
70
- description: 'External invalid state, independent of browser constraints or consumer business validation.',
70
+ description: 'External invalid state when the visible error is supplied elsewhere, independent of browser constraints or consumer business validation.',
71
71
  },
72
72
  required: {
73
73
  type: 'boolean',
@@ -134,13 +134,6 @@ export const textFieldContract = defineContract({
134
134
  example: 'search',
135
135
  description: 'Optional structured decorative icon after the editable text.',
136
136
  },
137
- iconFocusScope: {
138
- type: 'enum',
139
- values: ['control', 'input'],
140
- default: 'control',
141
- reflect: true,
142
- description: 'When configured icon focus colors apply: control includes the input and clear/reveal buttons; input includes only the editable input. Does not change icons without a focus-color override.',
143
- },
144
137
  prefix: {
145
138
  type: 'string',
146
139
  description: 'Optional non-interactive text decoration before the editable text.',
@@ -217,9 +210,7 @@ export const textFieldContract = defineContract({
217
210
  '--cosm-text-field-focus': 'Visible focus indicator color.',
218
211
  '--cosm-text-field-radius': 'Editable control corner radius.',
219
212
  '--cosm-text-field-start-icon-color': 'Start icon color, independent of text and affixes.',
220
- '--cosm-text-field-start-icon-focus-color': 'Start icon color within iconFocusScope; falls back to its normal color.',
221
213
  '--cosm-text-field-end-icon-color': 'End icon color, independent of text and affixes.',
222
- '--cosm-text-field-end-icon-focus-color': 'End icon color within iconFocusScope; falls back to its normal color.',
223
214
  },
224
215
  keyboard: [
225
216
  { keys: ['Tab', 'Shift+Tab'], action: 'Moves focus to or from the enabled editable control.' },
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/specs/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYhD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,iBAAiB;IACtB,WAAW,EACT,8HAA8H;IAChI,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,mDAAmD;IAC5D,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,oGAAoG;SACvG;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,8EAA8E;SAC5F;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mHAAmH;SACtH;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EACT,6GAA6G;SAChH;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;YAC7D,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EACT,mGAAmG;SACtG;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;YAC9B,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,2CAA2C;SACzD;QACD,IAAI,EAAE;YACJ,IAAI,EA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AAE,qDAAqD;QAC1D,IAAI,EAAE,qDAAqD;QAC3D,KAAK,EAAE,4EAA4E;QACnF,cAAc,EAAE,mCAAmC;QACnD,eAAe,EAAE,iDAAiD;KACnE;IACD,aAAa,EAAE;QACb,8BAA8B,EAAE,8BAA8B;QAC9D,yBAAyB,EAAE,qCAAqC;QAChE,+BAA+B,EAAE,yBAAyB;QAC1D,0BAA0B,EAAE,kCAAkC;QAC9D,yBAAyB,EAAE,gCAAgC;QAC3D,0BAA0B,EAAE,iCAAiC;QAC7D,oCAAoC,EAAE,oDAAoD;QAC1F,kCAAkC,EAAE,kDAAkD;KACvF;IACD,QAAQ,EAAE;QACR,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,sDAAsD,EAAE;QAC9F,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,8DAA8D,EAAE;KAC5F;CACF,CAAC,CAAC"}
@@ -28,6 +28,8 @@ export interface TextFieldScenario {
28
28
  readOnly?: boolean;
29
29
  clearable?: boolean;
30
30
  passwordReveal?: boolean;
31
+ invalid?: boolean;
32
+ errorText?: string;
31
33
  type?: 'text' | 'email' | 'password' | 'tel' | 'url' | 'search';
32
34
  };
33
35
  actions: readonly TextFieldAction[];
@@ -40,6 +42,7 @@ export interface TextFieldScenario {
40
42
  selectionStart?: number;
41
43
  compositionPreserved?: boolean;
42
44
  passwordVisible?: boolean;
45
+ invalid?: boolean;
43
46
  };
44
47
  platforms?: readonly Platform[];
45
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.scenarios.d.ts","sourceRoot":"","sources":["../../src/specs/text-field.scenarios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,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