@trimble-oss/moduswebcomponents-mcp 1.0.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 (108) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +337 -0
  3. package/package.json +39 -0
  4. package/versions/1.0.0/component-docs/_all_components.json +56 -0
  5. package/versions/1.0.0/component-docs/modus-wc-autocomplete.json +415 -0
  6. package/versions/1.0.0/component-docs/modus-wc-date.json +227 -0
  7. package/versions/1.0.0/component-docs/modus-wc-dropdown-menu.json +164 -0
  8. package/versions/1.0.0/component-docs/modus-wc-logo.json +61 -0
  9. package/versions/1.0.0/component-docs/modus-wc-menu-item.json +165 -0
  10. package/versions/1.0.0/component-docs/modus-wc-menu.json +106 -0
  11. package/versions/1.0.0/component-docs/modus-wc-navbar.json +290 -0
  12. package/versions/1.0.0/component-docs/modus-wc-profile-menu.json +64 -0
  13. package/versions/1.0.0/component-docs/modus-wc-side-navigation.json +102 -0
  14. package/versions/1.0.0/component-docs/modus-wc-table.json +202 -0
  15. package/versions/1.0.0/component-docs/modus-wc-tooltip.json +94 -0
  16. package/versions/1.0.0/component-docs/modus-wc-typography.json +78 -0
  17. package/versions/1.0.0/docs/_all_docs.json +15 -0
  18. package/versions/1.0.0/docs/angular.mdx +374 -0
  19. package/versions/1.0.0/docs/getting-started.mdx +131 -0
  20. package/versions/1.0.7/component-docs/_all_components.json +55 -0
  21. package/versions/1.0.7/component-docs/modus-wc-autocomplete.json +405 -0
  22. package/versions/1.0.7/component-docs/modus-wc-table.json +202 -0
  23. package/versions/1.0.7/component-docs/modus-wc-tooltip.json +94 -0
  24. package/versions/1.0.7/docs/_all_docs.json +15 -0
  25. package/versions/1.0.7/docs/angular.mdx +374 -0
  26. package/versions/1.1.0/component-docs/_all_components.json +56 -0
  27. package/versions/1.1.0/component-docs/modus-wc-autocomplete.json +405 -0
  28. package/versions/1.1.0/component-docs/modus-wc-navbar.json +290 -0
  29. package/versions/1.1.0/component-docs/modus-wc-profile-menu.json +64 -0
  30. package/versions/1.1.0/component-docs/modus-wc-side-navigation.json +102 -0
  31. package/versions/1.1.0/component-docs/modus-wc-table.json +202 -0
  32. package/versions/1.1.0/component-docs/modus-wc-tooltip.json +94 -0
  33. package/versions/1.1.0/component-docs/modus-wc-typography.json +78 -0
  34. package/versions/1.1.0/docs/_all_docs.json +15 -0
  35. package/versions/1.1.0/docs/angular.mdx +374 -0
  36. package/versions/1.1.0/docs/getting-started.mdx +131 -0
  37. package/versions/1.1.1/component-docs/_all_components.json +56 -0
  38. package/versions/1.1.1/component-docs/modus-wc-autocomplete.json +405 -0
  39. package/versions/1.1.1/component-docs/modus-wc-navbar.json +290 -0
  40. package/versions/1.1.1/component-docs/modus-wc-profile-menu.json +64 -0
  41. package/versions/1.1.1/component-docs/modus-wc-side-navigation.json +102 -0
  42. package/versions/1.1.1/component-docs/modus-wc-table.json +202 -0
  43. package/versions/1.1.1/component-docs/modus-wc-tooltip.json +94 -0
  44. package/versions/1.1.1/component-docs/modus-wc-typography.json +78 -0
  45. package/versions/1.1.1/docs/_all_docs.json +15 -0
  46. package/versions/1.1.1/docs/angular.mdx +374 -0
  47. package/versions/1.1.1/docs/getting-started.mdx +131 -0
  48. package/versions/base/component-docs/_all_components.json +55 -0
  49. package/versions/base/component-docs/modus-wc-accordion.json +48 -0
  50. package/versions/base/component-docs/modus-wc-alert.json +112 -0
  51. package/versions/base/component-docs/modus-wc-autocomplete.json +397 -0
  52. package/versions/base/component-docs/modus-wc-avatar.json +83 -0
  53. package/versions/base/component-docs/modus-wc-badge.json +68 -0
  54. package/versions/base/component-docs/modus-wc-breadcrumbs.json +63 -0
  55. package/versions/base/component-docs/modus-wc-button-group.json +100 -0
  56. package/versions/base/component-docs/modus-wc-button.json +130 -0
  57. package/versions/base/component-docs/modus-wc-card.json +98 -0
  58. package/versions/base/component-docs/modus-wc-checkbox.json +149 -0
  59. package/versions/base/component-docs/modus-wc-chip.json +132 -0
  60. package/versions/base/component-docs/modus-wc-collapse.json +90 -0
  61. package/versions/base/component-docs/modus-wc-date.json +227 -0
  62. package/versions/base/component-docs/modus-wc-divider.json +85 -0
  63. package/versions/base/component-docs/modus-wc-dropdown-menu.json +154 -0
  64. package/versions/base/component-docs/modus-wc-file-dropzone.json +155 -0
  65. package/versions/base/component-docs/modus-wc-handle.json +135 -0
  66. package/versions/base/component-docs/modus-wc-icon.json +722 -0
  67. package/versions/base/component-docs/modus-wc-input-feedback.json +71 -0
  68. package/versions/base/component-docs/modus-wc-input-label.json +84 -0
  69. package/versions/base/component-docs/modus-wc-loader.json +65 -0
  70. package/versions/base/component-docs/modus-wc-logo.json +61 -0
  71. package/versions/base/component-docs/modus-wc-menu-item.json +173 -0
  72. package/versions/base/component-docs/modus-wc-menu.json +86 -0
  73. package/versions/base/component-docs/modus-wc-modal.json +108 -0
  74. package/versions/base/component-docs/modus-wc-navbar.json +280 -0
  75. package/versions/base/component-docs/modus-wc-number-input.json +219 -0
  76. package/versions/base/component-docs/modus-wc-pagination.json +103 -0
  77. package/versions/base/component-docs/modus-wc-panel.json +76 -0
  78. package/versions/base/component-docs/modus-wc-progress.json +86 -0
  79. package/versions/base/component-docs/modus-wc-radio.json +139 -0
  80. package/versions/base/component-docs/modus-wc-rating.json +117 -0
  81. package/versions/base/component-docs/modus-wc-select.json +159 -0
  82. package/versions/base/component-docs/modus-wc-side-navigation.json +102 -0
  83. package/versions/base/component-docs/modus-wc-skeleton.json +65 -0
  84. package/versions/base/component-docs/modus-wc-slider.json +163 -0
  85. package/versions/base/component-docs/modus-wc-stepper.json +47 -0
  86. package/versions/base/component-docs/modus-wc-switch.json +149 -0
  87. package/versions/base/component-docs/modus-wc-table.json +202 -0
  88. package/versions/base/component-docs/modus-wc-tabs.json +86 -0
  89. package/versions/base/component-docs/modus-wc-text-input.json +278 -0
  90. package/versions/base/component-docs/modus-wc-textarea.json +215 -0
  91. package/versions/base/component-docs/modus-wc-theme-switcher.json +49 -0
  92. package/versions/base/component-docs/modus-wc-time-input.json +211 -0
  93. package/versions/base/component-docs/modus-wc-toast.json +56 -0
  94. package/versions/base/component-docs/modus-wc-toolbar.json +44 -0
  95. package/versions/base/component-docs/modus-wc-tooltip.json +94 -0
  96. package/versions/base/component-docs/modus-wc-typography.json +73 -0
  97. package/versions/base/component-docs/modus-wc-utility-panel.json +86 -0
  98. package/versions/base/docs/_all_docs.json +15 -0
  99. package/versions/base/docs/accessibility.mdx +32 -0
  100. package/versions/base/docs/angular.mdx +346 -0
  101. package/versions/base/docs/form-inputs.mdx +86 -0
  102. package/versions/base/docs/getting-started.mdx +91 -0
  103. package/versions/base/docs/modus-figma-mcp-integration-guide.mdx +254 -0
  104. package/versions/base/docs/modus-icon-usage.mdx +210 -0
  105. package/versions/base/docs/react.mdx +129 -0
  106. package/versions/base/docs/styling.mdx +107 -0
  107. package/versions/base/docs/testing.mdx +18 -0
  108. package/versions/base/docs/vue.mdx +159 -0
@@ -0,0 +1,149 @@
1
+ {
2
+ "description": "A customizable checkbox component",
3
+ "properties": [
4
+ {
5
+ "name": "customClass",
6
+ "type": "string",
7
+ "description": "Custom CSS class to apply to the inner div.",
8
+ "default": "''",
9
+ "mutable": false,
10
+ "end_line": 29
11
+ },
12
+ {
13
+ "name": "disabled",
14
+ "type": "boolean",
15
+ "description": "The disabled state of the checkbox.",
16
+ "default": "false",
17
+ "mutable": false,
18
+ "end_line": 32
19
+ },
20
+ {
21
+ "name": "indeterminate",
22
+ "type": "boolean",
23
+ "description": "The indeterminate state of the checkbox.",
24
+ "default": "false",
25
+ "mutable": true,
26
+ "end_line": 35
27
+ },
28
+ {
29
+ "name": "inputId",
30
+ "type": "string",
31
+ "description": "The ID of the input element.",
32
+ "default": null,
33
+ "mutable": false,
34
+ "end_line": 38
35
+ },
36
+ {
37
+ "name": "inputTabIndex",
38
+ "type": "number",
39
+ "description": "The tabindex of the input.",
40
+ "default": null,
41
+ "mutable": false,
42
+ "end_line": 41
43
+ },
44
+ {
45
+ "name": "label",
46
+ "type": "string",
47
+ "description": "The text to display within the label.",
48
+ "default": null,
49
+ "mutable": false,
50
+ "end_line": 44
51
+ },
52
+ {
53
+ "name": "name",
54
+ "type": "string",
55
+ "description": "Name of the form control. Submitted with the form as part of a name/value pair.",
56
+ "default": "''",
57
+ "mutable": false,
58
+ "end_line": 47
59
+ },
60
+ {
61
+ "name": "required",
62
+ "type": "boolean",
63
+ "description": "A value is required for the form to be submittable.",
64
+ "default": "false",
65
+ "mutable": false,
66
+ "end_line": 50
67
+ },
68
+ {
69
+ "name": "size",
70
+ "type": "ModusSize",
71
+ "description": "The size of the input.",
72
+ "default": "'md'",
73
+ "mutable": false,
74
+ "end_line": 53
75
+ },
76
+ {
77
+ "name": "value",
78
+ "type": "boolean",
79
+ "description": "The value of the checkbox.",
80
+ "default": "false",
81
+ "mutable": true,
82
+ "end_line": 56
83
+ }
84
+ ],
85
+ "events": [
86
+ {
87
+ "name": "inputBlur",
88
+ "detail": "FocusEvent",
89
+ "description": "Emitted when the input loses focus.",
90
+ "end_line": 59
91
+ },
92
+ {
93
+ "name": "inputChange",
94
+ "detail": "InputEvent",
95
+ "description": "Emitted when the input value changes.",
96
+ "end_line": 62
97
+ },
98
+ {
99
+ "name": "inputFocus",
100
+ "detail": "FocusEvent",
101
+ "description": "Emitted when the input gains focus.",
102
+ "end_line": 65
103
+ }
104
+ ],
105
+ "methods": [],
106
+ "slots": [],
107
+ "examples": {
108
+ "basic": "<modus-wc-checkbox\n aria-label=\"Checkbox\"\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .indeterminate=${args.indeterminate}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n name=${ifDefined(args.name)}\n ?required=${args.required}\n size=${ifDefined(args.size)}\n .value=${args.value}\n ></modus-wc-checkbox>",
109
+ "variations": [],
110
+ "args": {
111
+ "custom-class": "''",
112
+ "disabled": "false",
113
+ "indeterminate": "false",
114
+ "label": "'Label'",
115
+ "name": "''",
116
+ "required": "false",
117
+ "size": "'md'",
118
+ "value": "true"
119
+ },
120
+ "argTypes": {},
121
+ "usage": [],
122
+ "events": [
123
+ "inputBlur",
124
+ "inputChange",
125
+ "inputFocus"
126
+ ]
127
+ },
128
+ "tag": "modus-wc-checkbox",
129
+ "storyExample": {
130
+ "template": "<modus-wc-checkbox\n aria-label=\"Checkbox\"\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .indeterminate=${args.indeterminate}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n name=${ifDefined(args.name)}\n ?required=${args.required}\n size=${ifDefined(args.size)}\n .value=${args.value}\n ></modus-wc-checkbox>",
131
+ "args": {
132
+ "custom-class": "''",
133
+ "disabled": "false",
134
+ "indeterminate": "false",
135
+ "label": "'Label'",
136
+ "name": "''",
137
+ "required": "false",
138
+ "size": "'md'",
139
+ "value": "true"
140
+ },
141
+ "argTypes": {},
142
+ "events": [
143
+ "inputBlur",
144
+ "inputChange",
145
+ "inputFocus"
146
+ ],
147
+ "fullContent": "import { withActions } from '@storybook/addon-actions/decorator';\nimport { Meta, StoryObj } from '@storybook/web-components';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createShadowHostClass } from '../../providers/shadow-dom/shadow-host-helper';\nimport { ModusSize } from '../types';\n\ninterface CheckboxArgs {\n 'custom-class'?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n 'input-id'?: string;\n 'input-tab-index'?: number;\n label?: string;\n name?: string;\n required?: boolean;\n size?: ModusSize;\n value: boolean;\n}\n\nconst meta: Meta<CheckboxArgs> = {\n title: 'Components/Forms/Checkbox',\n component: 'modus-wc-checkbox',\n args: {\n 'custom-class': '',\n disabled: false,\n indeterminate: false,\n label: 'Label',\n name: '',\n required: false,\n size: 'md',\n value: true,\n },\n argTypes: {\n size: {\n control: { type: 'select' },\n options: ['sm', 'md', 'lg'],\n },\n },\n decorators: [withActions],\n parameters: {\n actions: {\n handles: ['inputBlur', 'inputChange', 'inputFocus'],\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<CheckboxArgs>;\n\nexport const Default: Story = {\n render: (args) => {\n return html`\n <modus-wc-checkbox\n aria-label=\"Checkbox\"\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .indeterminate=${args.indeterminate}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n name=${ifDefined(args.name)}\n ?required=${args.required}\n size=${ifDefined(args.size)}\n .value=${args.value}\n ></modus-wc-checkbox>\n `;\n },\n};\n\nexport const ShadowDomParent: Story = {\n render: (args) => {\n // Create a unique shadow host for checkbox component\n if (!customElements.get('checkbox-shadow-host')) {\n const CheckboxShadowHost = createShadowHostClass<CheckboxArgs>({\n componentTag: 'modus-wc-checkbox',\n propsMapper: (v: CheckboxArgs, el: HTMLElement) => {\n const checkboxEl = el as unknown as {\n customClass: string;\n disabled: boolean;\n indeterminate: boolean;\n inputId: string;\n inputTabIndex: number;\n label: string;\n name: string;\n required: boolean;\n size: string;\n value: boolean;\n };\n checkboxEl.customClass = v['custom-class'] || '';\n checkboxEl.disabled = Boolean(v.disabled);\n checkboxEl.indeterminate = Boolean(v.indeterminate);\n checkboxEl.inputId = v['input-id'] ?? '';\n checkboxEl.inputTabIndex = v['input-tab-index'] ?? 0;\n checkboxEl.label = v.label ?? '';\n checkboxEl.name = v.name ?? '';\n checkboxEl.required = Boolean(v.required);\n checkboxEl.size = v.size ?? '';\n checkboxEl.value = Boolean(v.value);\n },\n });\n customElements.define('checkbox-shadow-host', CheckboxShadowHost);\n }\n\n return html`<checkbox-shadow-host\n .props=${{ ...args }}\n ></checkbox-shadow-host>`;\n },\n};\n\nexport const Migration: Story = {\n parameters: {\n docs: {\n description: {\n story: `\n#### Breaking Changes\n\n - In 1.0 input state was maintained by the component. 2.0 components encourage users to follow a controlled\n input model. See the Form Inputs [documentation]([Angular](?path=/docs/documentation-form-inputs--docs) for\n additional info and examples.\n - The \\`checked\\` prop is now \\`value\\` in 2.0.\n - The \\`checkboxClick\\` event is now \\`inputChange\\` in 2.0.\n - Size values have changed from verbose names (\\`small\\`, \\`medium\\`) to abbreviations (\\`sm\\`, \\`md\\`, \\`lg\\`).\n\n#### Prop Mapping\n\n| 1.0 Prop | 2.0 Prop | Notes |\n|------------------|---------------|-----------------------------------------|\n| aria-label | aria-label | |\n| checked | value | |\n| disabled | disabled | |\n| indeterminate | indeterminate | |\n| label | label | |\n| size | size | \\`small\\` → \\`sm\\`, \\`medium\\` → \\`md\\` |\n| stop-propagation | | Not carried over |\n\n#### Event Mapping\n\n| 1.0 Event | 2.0 Event | Notes |\n|---------------|-------------|-------------------------------------------------------|\n| checkboxClick | inputChange | Event now emits \\`InputEvent\\` instead of \\`boolean\\` |\n `,\n },\n },\n controls: { disable: true },\n canvas: { disable: true },\n },\n render: () => html`<div></div>`,\n};\n"
148
+ }
149
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "description": "A customizable chip component used to display information in a compact area The component supports a `<slot>` for injecting custom content such as avatar and icons.",
3
+ "properties": [
4
+ {
5
+ "name": "active",
6
+ "type": "boolean",
7
+ "description": "Active state of chip.",
8
+ "default": "false",
9
+ "mutable": false,
10
+ "end_line": 32
11
+ },
12
+ {
13
+ "name": "customClass",
14
+ "type": "string",
15
+ "description": "Custom CSS class to apply to the inner div.",
16
+ "default": "''",
17
+ "mutable": false,
18
+ "end_line": 35
19
+ },
20
+ {
21
+ "name": "disabled",
22
+ "type": "boolean",
23
+ "description": "Whether the chip is disabled.",
24
+ "default": "false",
25
+ "mutable": false,
26
+ "end_line": 38
27
+ },
28
+ {
29
+ "name": "hasError",
30
+ "type": "boolean",
31
+ "description": "Whether the chip has an error.",
32
+ "default": "false",
33
+ "mutable": false,
34
+ "end_line": 41
35
+ },
36
+ {
37
+ "name": "label",
38
+ "type": "string",
39
+ "description": "The label to display in the chip.",
40
+ "default": "''",
41
+ "mutable": false,
42
+ "end_line": 44
43
+ },
44
+ {
45
+ "name": "showRemove",
46
+ "type": "boolean",
47
+ "description": "Whether to show the close icon on right side of the chip.",
48
+ "default": "false",
49
+ "mutable": false,
50
+ "end_line": 47
51
+ },
52
+ {
53
+ "name": "shape",
54
+ "type": "'rectangle' | 'circle'",
55
+ "description": "The shape of the chip: 'rectangle' (default) or 'circle'.",
56
+ "default": "'rectangle'",
57
+ "mutable": false,
58
+ "end_line": 50
59
+ },
60
+ {
61
+ "name": "size",
62
+ "type": "ModusSize",
63
+ "description": "The size of the chip.",
64
+ "default": "'md'",
65
+ "mutable": false,
66
+ "end_line": 53
67
+ },
68
+ {
69
+ "name": "variant",
70
+ "type": "'filled' | 'outline'",
71
+ "description": "The variant of the chip.",
72
+ "default": "'filled'",
73
+ "mutable": false,
74
+ "end_line": 56
75
+ }
76
+ ],
77
+ "events": [
78
+ {
79
+ "name": "chipClick",
80
+ "detail": "MouseEvent | KeyboardEvent",
81
+ "description": "Event emitted when the chip is clicked or activated via keyboard.",
82
+ "end_line": 59
83
+ },
84
+ {
85
+ "name": "chipRemove",
86
+ "detail": "MouseEvent | KeyboardEvent",
87
+ "description": "Event emitted when the close chip icon button is clicked.",
88
+ "end_line": 62
89
+ }
90
+ ],
91
+ "methods": [],
92
+ "slots": [
93
+ {
94
+ "name": "default",
95
+ "description": "Slot for default content"
96
+ }
97
+ ],
98
+ "examples": {
99
+ "basic": "<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n label=${args.label}\n shape=${args.shape}\n show-remove=${ifDefined(args['show-remove'])}\n size=${args.size}\n variant=${args.variant}\n />",
100
+ "variations": [],
101
+ "args": {
102
+ "label": "'Chip'",
103
+ "show-remove": "true",
104
+ "shape": "'rectangle'",
105
+ "size": "'md'",
106
+ "variant": "'filled'"
107
+ },
108
+ "argTypes": {},
109
+ "usage": [],
110
+ "events": [
111
+ "chipClick",
112
+ "chipRemove"
113
+ ]
114
+ },
115
+ "tag": "modus-wc-chip",
116
+ "storyExample": {
117
+ "template": "<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n label=${args.label}\n shape=${args.shape}\n show-remove=${ifDefined(args['show-remove'])}\n size=${args.size}\n variant=${args.variant}\n />",
118
+ "args": {
119
+ "label": "'Chip'",
120
+ "show-remove": "true",
121
+ "shape": "'rectangle'",
122
+ "size": "'md'",
123
+ "variant": "'filled'"
124
+ },
125
+ "argTypes": {},
126
+ "events": [
127
+ "chipClick",
128
+ "chipRemove"
129
+ ],
130
+ "fullContent": "import { withActions } from '@storybook/addon-actions/decorator';\nimport { Meta, StoryObj } from '@storybook/web-components';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createShadowHostClass } from '../../providers/shadow-dom/shadow-host-helper';\nimport { ModusSize } from '../types';\n\ninterface ChipArgs {\n active?: boolean;\n 'custom-class'?: string;\n disabled?: boolean;\n 'has-error'?: boolean;\n label: string;\n shape?: 'rectangle' | 'circle';\n 'show-remove'?: boolean;\n size: ModusSize;\n variant: 'filled' | 'outline';\n}\n\nconst meta: Meta<ChipArgs> = {\n title: 'Components/Chip',\n component: 'modus-wc-chip',\n args: {\n label: 'Chip',\n 'show-remove': true,\n shape: 'rectangle',\n size: 'md',\n variant: 'filled',\n },\n argTypes: {\n shape: {\n control: { type: 'select' },\n options: ['rectangle', 'circle'],\n },\n size: {\n control: { type: 'select' },\n options: ['sm', 'md', 'lg'],\n },\n variant: {\n control: { type: 'select' },\n options: ['filled', 'outline'],\n },\n },\n decorators: [withActions],\n parameters: {\n actions: {\n handles: ['chipClick', 'chipRemove'],\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<ChipArgs>;\n\nconst Template: Story = {\n render: (args) => {\n return html` <modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n label=${args.label}\n shape=${args.shape}\n show-remove=${ifDefined(args['show-remove'])}\n size=${args.size}\n variant=${args.variant}\n />`;\n },\n};\n\nexport const Default: Story = { ...Template };\n\nexport const AvatarChip: Story = {\n render: (args) => {\n // prettier-ignore\n return html`\n<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n label=${args.label}\n shape=${args.shape}\n show-remove=${ifDefined(args['show-remove'])}\n size=${args.size}\n variant=${args.variant}\n>\n <modus-wc-avatar\n img-src=\"https://i.pinimg.com/474x/73/54/79/7354794bf3873c3ef2666f778da4bcac.jpg\"\n alt=\"sonic the hedgehog\"\n ></modus-wc-avatar>\n</modus-wc-chip>\n `;\n },\n};\n\nexport const CheckIconChip: Story = {\n render: (args) => {\n // prettier-ignore\n return html`\n<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n label=${args.label}\n shape=${args.shape}\n show-remove=${ifDefined(args['show-remove'])}\n size=${args.size}\n variant=${args.variant}\n>\n <modus-wc-icon name=\"check\" size=\"xs\"></modus-wc-icon>\n</modus-wc-chip>\n `;\n },\n};\n\n// prettier-ignore\nexport const Composable: Story = {\n render: (args) => {\n return html`\n<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n shape=${args.shape}\n size=${args.size}\n variant=${args.variant}\n>\n <modus-wc-icon name=\"heart\" size=\"xs\"></modus-wc-icon>\n Chip\n</modus-wc-chip>\n\n<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n shape=${args.shape}\n show-remove=\"true\"\n size=${args.size}\n variant=${args.variant}\n>\n <modus-wc-icon name=\"heart\" size=\"xs\"></modus-wc-icon>\n Chip\n</modus-wc-chip>\n\n<modus-wc-chip\n aria-label=\"Chip example\"\n active=${ifDefined(args.active)}\n disabled=${ifDefined(args.disabled)}\n has-error=${ifDefined(args['has-error'])}\n shape=${args.shape}\n size=${args.size}\n variant=${args.variant}\n>\n <modus-wc-icon name=\"heart\" size=\"xs\"></modus-wc-icon>\n Chip\n <modus-wc-icon name=\"heart\" size=\"xs\"></modus-wc-icon>\n</modus-wc-chip>\n `;\n },\n};\n\nexport const ShadowDomParent: Story = {\n render: (args) => {\n // Create a unique shadow host for chip component\n if (!customElements.get('chip-shadow-host')) {\n const ChipShadowHost = createShadowHostClass<ChipArgs>({\n componentTag: 'modus-wc-chip',\n propsMapper: (v: ChipArgs, el: HTMLElement) => {\n const chipEl = el as unknown as {\n ariaLabel: string;\n active: boolean;\n customClass: string;\n disabled: boolean;\n hasError: boolean;\n label: string;\n shape: string;\n showRemove: boolean;\n size: string;\n variant: string;\n };\n chipEl.ariaLabel = 'Click me chip';\n chipEl.active = Boolean(v.active);\n chipEl.shape = v.shape || 'rectangle';\n chipEl.size = v.size;\n chipEl.variant = v.variant;\n chipEl.customClass = v['custom-class'] || '';\n chipEl.disabled = Boolean(v.disabled);\n chipEl.hasError = Boolean(v['has-error']);\n chipEl.label = v.label;\n chipEl.showRemove = Boolean(v['show-remove']);\n },\n });\n customElements.define('chip-shadow-host', ChipShadowHost);\n }\n\n return html`<chip-shadow-host .props=${{ ...args }}></chip-shadow-host>`;\n },\n};\n\nexport const Migration: Story = {\n parameters: {\n docs: {\n description: {\n story: `\n#### Breaking Changes\n\n - \\`chip-style\\` prop has been renamed to \\`variant\\` and values changed from \\`solid\\` to \\`filled\\`.\n - \\`closeClick\\` event has been renamed to \\`chipRemove\\`.\n - \\`show-close\\` prop has been renamed to \\`show-remove\\`.\n - Size values have changed from verbose names (\\`medium\\`, \\`small\\`) to abbreviations (\\`md\\`, \\`sm\\`).\n\n#### Prop Mapping\n\n| 1.0 Prop | 2.0 Prop | Notes |\n|----------------|-------------|---------------------------------------------------|\n| active | active | |\n| advanced-chip | | Not carried over |\n| aria-label | aria-label | |\n| chip-id | | Not carried over |\n| chip-style | variant | \\`solid\\` → \\`filled\\`, \\`outline\\` → \\`outline\\` |\n| disabled | disabled | |\n| has-error | has-error | |\n| image-url | | Not carried over, use slot instead |\n| max-width | | Not carried over, use CSS instead |\n| show-checkmark | | Not carried over, use slot instead |\n| show-close | show-remove | |\n| size | size | \\`medium\\` → \\`md\\`, \\`small\\` → \\`sm\\` |\n| value | label | |\n| | shape | New in 2.0: \\`rectangle\\` (default), \\`circle\\` |\n\n#### Event Mapping\n\n| 1.0 Event | 2.0 Event | Notes |\n|-------------|-------------|-------|\n| chipClick | chipClick | |\n| closeClick | chipRemove | |\n `,\n },\n },\n controls: { disable: true },\n canvas: { disable: true },\n },\n render: () => html`<div></div>`,\n};\n"
131
+ }
132
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "description": "A customizable collapse component used for showing and hiding content. The component supports a 'header' and 'content' `<slot>` for injecting custom HTML.",
3
+ "properties": [
4
+ {
5
+ "name": "bordered",
6
+ "type": "boolean",
7
+ "description": "Indicates that the component should have a border.",
8
+ "default": "false",
9
+ "mutable": false,
10
+ "end_line": 52
11
+ },
12
+ {
13
+ "name": "customClass",
14
+ "type": "string",
15
+ "description": "Custom CSS class to apply to the outer div.",
16
+ "default": "''",
17
+ "mutable": false,
18
+ "end_line": 55
19
+ },
20
+ {
21
+ "name": "expanded",
22
+ "type": "boolean",
23
+ "description": "Controls whether the collapse is expanded or not.",
24
+ "default": "false",
25
+ "mutable": true,
26
+ "end_line": 58
27
+ },
28
+ {
29
+ "name": "collapseId",
30
+ "type": "string",
31
+ "description": "A unique identifier used to set the id attributes of various elements.",
32
+ "default": null,
33
+ "mutable": true,
34
+ "end_line": 61
35
+ },
36
+ {
37
+ "name": "options",
38
+ "type": "ICollapseOptions",
39
+ "description": "Configuration options for rendering the pre-laid out collapse component. Do not set this prop if you intend to use the 'header' slot.",
40
+ "default": null,
41
+ "mutable": false,
42
+ "end_line": 67
43
+ }
44
+ ],
45
+ "events": [
46
+ {
47
+ "name": "expandedChange",
48
+ "detail": "{ expanded: boolean }",
49
+ "description": "Event emitted when the expanded prop is internally changed.",
50
+ "end_line": 70
51
+ }
52
+ ],
53
+ "methods": [],
54
+ "slots": [
55
+ {
56
+ "name": "header",
57
+ "description": "Slot for header content"
58
+ },
59
+ {
60
+ "name": "content",
61
+ "description": "Slot for content content"
62
+ }
63
+ ],
64
+ "examples": {
65
+ "basic": "<modus-wc-collapse\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?expanded=${args.expanded}\n id=${ifDefined(args.id)}\n .options=${args.options}\n>\n <div slot=\"content\">Collapse content</div>\n</modus-wc-collapse>\n<script>\n// Adding this block to show how to set options via JS.\n// const options = {\n// title: 'Collapse Title',\n// description: 'Collapse description',\n// icon: 'alert',\n// iconAriaLabel: 'Alert',\n// };\n// const collapse = document.querySelector('modus-wc-collapse');\n// collapse.options = options;\n</script>",
66
+ "variations": [],
67
+ "args": {
68
+ "bordered": "false",
69
+ "expanded": "false"
70
+ },
71
+ "argTypes": {},
72
+ "usage": [],
73
+ "events": [
74
+ "expandedChange"
75
+ ]
76
+ },
77
+ "tag": "modus-wc-collapse",
78
+ "storyExample": {
79
+ "template": "<modus-wc-collapse\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?expanded=${args.expanded}\n id=${ifDefined(args.id)}\n .options=${args.options}\n>\n <div slot=\"content\">Collapse content</div>\n</modus-wc-collapse>\n<script>\n// Adding this block to show how to set options via JS.\n// const options = {\n// title: 'Collapse Title',\n// description: 'Collapse description',\n// icon: 'alert',\n// iconAriaLabel: 'Alert',\n// };\n// const collapse = document.querySelector('modus-wc-collapse');\n// collapse.options = options;\n</script>",
80
+ "args": {
81
+ "bordered": "false",
82
+ "expanded": "false"
83
+ },
84
+ "argTypes": {},
85
+ "events": [
86
+ "expandedChange"
87
+ ],
88
+ "fullContent": "import { withActions } from '@storybook/addon-actions/decorator';\nimport { Meta, StoryObj } from '@storybook/web-components';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { ICollapseOptions } from './modus-wc-collapse';\nimport { createShadowHostClass } from '../../providers/shadow-dom/shadow-host-helper';\n\ninterface CollapseArgs {\n bordered?: boolean;\n 'custom-class'?: string;\n expanded?: boolean;\n id?: string;\n options?: ICollapseOptions;\n}\n\nconst options: ICollapseOptions = {\n title: 'Collapse Title',\n description: 'Collapse description',\n icon: 'alert',\n iconAriaLabel: 'Alert',\n};\n\nconst meta: Meta<CollapseArgs> = {\n title: 'Components/Collapse',\n component: 'modus-wc-collapse',\n args: { bordered: false, expanded: false, options },\n argTypes: {\n options: {\n description: 'Configuration options for the collapse component',\n table: {\n type: {\n detail: `\n Interface: ICollapseOptions\n Properties:\n - description (string, optional): The description to render in the collapse header\n - icon (string, optional): The Modus icon name to render in the collapse header\n - iconAriaLabel (string, optional): The icon's aria-label\n - size (DaisySize, optional): The size of the collapse header\n - title (string): The title to render in the collapse header\n `,\n },\n },\n },\n },\n decorators: [withActions],\n parameters: { actions: { handles: ['expandedChange'] }, layout: 'padded' },\n};\n\nexport default meta;\n\ntype Story = StoryObj<CollapseArgs>;\n\nconst Template: Story = {\n render: (args) => {\n // prettier-ignore\n return html`\n<modus-wc-collapse\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?expanded=${args.expanded}\n id=${ifDefined(args.id)}\n .options=${args.options}\n>\n <div slot=\"content\">Collapse content</div>\n</modus-wc-collapse>\n<script>\n// Adding this block to show how to set options via JS.\n// const options = {\n// title: 'Collapse Title',\n// description: 'Collapse description',\n// icon: 'alert',\n// iconAriaLabel: 'Alert',\n// };\n// const collapse = document.querySelector('modus-wc-collapse');\n// collapse.options = options;\n</script>\n `;\n },\n};\n\nexport const Default: Story = { ...Template };\n\nexport const WithCustomClickableHeader = {\n render: (args) => {\n const handleButtonClick = () => {\n window.alert('Button was clicked!');\n };\n\n // prettier-ignore\n return html`\n<style>\n .clickable-div {\n position: relative;\n width: fit-content;\n z-index: 99;\n }\n</style>\n<modus-wc-collapse\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?expanded=${args.expanded}\n id=\"123\"\n>\n <div slot=\"header\" class=\"modus-wc-collapse-title\" id=\"123\">\n <div class=\"clickable-div\">\n <modus-wc-button id=\"button1\" @buttonClick=${handleButtonClick}>Alert 1</modus-wc-button>\n <modus-wc-button id=\"button2\" @buttonClick=${handleButtonClick}>Alert 2</modus-wc-button>\n </div>\n </div>\n <div slot=\"content\">Collapse content</div>\n</modus-wc-collapse>\n<script>\n// Adding this block to show how to add clickable buttons in the collapse header via JS.\n// function handleButtonClick() {\n// window.alert('Button was clicked!');\n// }\n// const button1 = document.getElementById('button1');\n// const button2 = document.getElementById('button2');\n// button1.addEventListener('click', handleButtonClick);\n// button2.addEventListener('click', handleButtonClick);\n</script>\n `;\n },\n};\n\nexport const ShadowDomParent: Story = {\n render: (args) => {\n // Create a unique shadow host for collapse component\n if (!customElements.get('collapse-shadow-host')) {\n const CollapseShadowHost = createShadowHostClass<CollapseArgs>({\n componentTag: 'modus-wc-collapse',\n propsMapper: (v: CollapseArgs, el: HTMLElement) => {\n const collapseEl = el as unknown as {\n bordered: boolean;\n customClass: string;\n expanded: boolean;\n id: string;\n options: ICollapseOptions;\n };\n // Only set innerHTML once on initial creation\n if (!el.querySelector('[slot=\"content\"]')) {\n el.innerHTML = '<div slot=\"content\">Collapse content</div>';\n }\n collapseEl.bordered = Boolean(v.bordered);\n collapseEl.customClass = v['custom-class'] || '';\n collapseEl.expanded = Boolean(v.expanded);\n collapseEl.id = v.id ?? '';\n if (v.options) {\n collapseEl.options = v.options; // Conditional assignment only if provided\n }\n },\n });\n customElements.define('collapse-shadow-host', CollapseShadowHost);\n }\n\n return html`<collapse-shadow-host\n .props=${{ ...args }}\n ></collapse-shadow-host>`;\n },\n};\n\nexport const Migration: Story = {\n parameters: {\n docs: {\n description: {\n story: `\n#### Breaking Changes\n\n - The 1.0 accordion-item component maps to the 2.0 collapse component. See the [Accordion component](?path=/docs/components-accordion--docs).\n - Size values have changed from \\`condensed\\`, \\`standard\\` in 1.0 to abbreviations (\\`xs\\`, \\`sm\\`, \\`md\\`, \\`lg\\`) in 2.0.\n\n#### Prop Mapping\n\n##### accordion-item (1.0) → collapse (2.0)\n\n| 1.0 Prop | 2.0 Prop | Notes |\n|--------------------|---------------------|------------------|\n| aria-label | aria-label | |\n| disabled | | Not carried over |\n| expand-button-type | | Not carried over |\n| expanded | expanded | |\n| header-text | options.title | |\n| icon | options.icon | |\n| size | options.size | |\n| supporting-label | options.description | |\n\n#### Event Mapping\n\n| 1.0 Event | 2.0 Event | Notes |\n|-----------|----------------|------------------|\n| closed | expandedChange | |\n| opened | expandedChange | |\n `,\n },\n },\n controls: { disable: true },\n canvas: { disable: true },\n },\n render: () => html`<div></div>`,\n};\n"
89
+ }
90
+ }
@@ -0,0 +1,227 @@
1
+ {
2
+ "description": "A customizable date picker component used to create date inputs. Adheres to WCAG 2.2 standards.",
3
+ "properties": [
4
+ {
5
+ "name": "bordered",
6
+ "type": "boolean",
7
+ "description": "Indicates that the input should have a border.",
8
+ "default": "true",
9
+ "mutable": false,
10
+ "end_line": 78
11
+ },
12
+ {
13
+ "name": "customClass",
14
+ "type": "string",
15
+ "description": "Custom CSS class to apply to the input.",
16
+ "default": "''",
17
+ "mutable": false,
18
+ "end_line": 81
19
+ },
20
+ {
21
+ "name": "disabled",
22
+ "type": "boolean",
23
+ "description": "Whether the form control is disabled.",
24
+ "default": "false",
25
+ "mutable": false,
26
+ "end_line": 84
27
+ },
28
+ {
29
+ "name": "feedback",
30
+ "type": "IInputFeedbackProp",
31
+ "description": "Feedback to render below the input.",
32
+ "default": null,
33
+ "mutable": false,
34
+ "end_line": 87
35
+ },
36
+ {
37
+ "name": "inputId",
38
+ "type": "string",
39
+ "description": "The ID of the input element.",
40
+ "default": null,
41
+ "mutable": false,
42
+ "end_line": 90
43
+ },
44
+ {
45
+ "name": "inputTabIndex",
46
+ "type": "number",
47
+ "description": "Determine the control's relative ordering for sequential focus navigation (typically with the Tab key).",
48
+ "default": null,
49
+ "mutable": false,
50
+ "end_line": 93
51
+ },
52
+ {
53
+ "name": "label",
54
+ "type": "string",
55
+ "description": "The text to display within the label.",
56
+ "default": null,
57
+ "mutable": false,
58
+ "end_line": 96
59
+ },
60
+ {
61
+ "name": "max",
62
+ "type": "string",
63
+ "description": "Maximum date value.",
64
+ "default": null,
65
+ "mutable": false,
66
+ "end_line": 99
67
+ },
68
+ {
69
+ "name": "min",
70
+ "type": "string",
71
+ "description": "Minimum date value.",
72
+ "default": null,
73
+ "mutable": false,
74
+ "end_line": 102
75
+ },
76
+ {
77
+ "name": "name",
78
+ "type": "string",
79
+ "description": "Name of the form control. Submitted with the form as part of a name/value pair.",
80
+ "default": null,
81
+ "mutable": false,
82
+ "end_line": 105
83
+ },
84
+ {
85
+ "name": "readOnly",
86
+ "type": "boolean",
87
+ "description": "Whether the value is editable.",
88
+ "default": "false",
89
+ "mutable": false,
90
+ "end_line": 108
91
+ },
92
+ {
93
+ "name": "required",
94
+ "type": "boolean",
95
+ "description": "A value is required or must be checked for the form to be submittable.",
96
+ "default": "false",
97
+ "mutable": false,
98
+ "end_line": 111
99
+ },
100
+ {
101
+ "name": "size",
102
+ "type": "ModusSize",
103
+ "description": "The size of the input.",
104
+ "default": "'md'",
105
+ "mutable": false,
106
+ "end_line": 114
107
+ },
108
+ {
109
+ "name": "format",
110
+ "type": "| 'yyyy-mm-dd' | 'dd-mm-yyyy' | 'mm-dd-yyyy' | 'yyyy/mm/dd' | 'dd/mm/yyyy' | 'mm/dd/yyyy' | 'MMM DD, YYYY'",
111
+ "description": "The date format for display and input.",
112
+ "default": "'dd-mm-yyyy'",
113
+ "mutable": false,
114
+ "end_line": 124
115
+ },
116
+ {
117
+ "name": "value",
118
+ "type": "string",
119
+ "description": "The value of the control.",
120
+ "default": "''",
121
+ "mutable": true,
122
+ "end_line": 127
123
+ },
124
+ {
125
+ "name": "weekStartDay",
126
+ "type": "WeekStartDay",
127
+ "description": "The first day of the week for the calendar display",
128
+ "default": "'sunday'",
129
+ "mutable": false,
130
+ "end_line": 130
131
+ },
132
+ {
133
+ "name": "showWeekNumbers",
134
+ "type": "boolean",
135
+ "description": "Displays ISO 8601 week numbers in the calendar.Week numbers are calculated with Monday as the first day of the week.",
136
+ "default": "false",
137
+ "mutable": false,
138
+ "end_line": 133
139
+ }
140
+ ],
141
+ "events": [
142
+ {
143
+ "name": "inputBlur",
144
+ "detail": "FocusEvent",
145
+ "description": "Event emitted when the input loses focus.",
146
+ "end_line": 136
147
+ },
148
+ {
149
+ "name": "inputChange",
150
+ "detail": "InputEvent",
151
+ "description": "Event emitted when the input value changes.",
152
+ "end_line": 139
153
+ },
154
+ {
155
+ "name": "inputFocus",
156
+ "detail": "FocusEvent",
157
+ "description": "Event emitted when the input gains focus.",
158
+ "end_line": 142
159
+ },
160
+ {
161
+ "name": "calendarMonthChange",
162
+ "detail": "number",
163
+ "description": "Event emitted when the calendar month selection changes.",
164
+ "end_line": 145
165
+ },
166
+ {
167
+ "name": "calendarYearChange",
168
+ "detail": "number",
169
+ "description": "Event emitted when the calendar year selection changes.",
170
+ "end_line": 148
171
+ }
172
+ ],
173
+ "methods": [],
174
+ "slots": [],
175
+ "examples": {
176
+ "basic": "<style>\n div[id^='story--components-forms-date--default'] {\n min-height: 400px;\n width: 300px;\n }\n </style>\n <modus-wc-date\n aria-label=\"Date input\"\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .feedback=${args.feedback}\n format=${ifDefined(args.format)}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n max=${ifDefined(args.max)}\n min=${ifDefined(args.min)}\n name=${ifDefined(args.name)}\n placeholder=${ifDefined(args.placeholder)}\n ?read-only=${args['read-only']}\n ?required=${args.required}\n ?show-week-numbers=${args['show-week-numbers']}\n size=${ifDefined(args.size)}\n .value=${args.value}\n week-start-day=${ifDefined(args['week-start-day'])}\n ></modus-wc-date>",
177
+ "variations": [],
178
+ "args": {
179
+ "bordered": "true",
180
+ "custom-class": "''",
181
+ "disabled": "false",
182
+ "label": "'Label'",
183
+ "read-only": "false",
184
+ "required": "false",
185
+ "show-week-numbers": "false",
186
+ "size": "'md'",
187
+ "value": "''",
188
+ "week-start-day": "'sunday'"
189
+ },
190
+ "argTypes": {},
191
+ "usage": [],
192
+ "events": [
193
+ "inputBlur",
194
+ "inputChange",
195
+ "inputFocus",
196
+ "calendarMonthChange",
197
+ "calendarYearChange",
198
+ ""
199
+ ]
200
+ },
201
+ "tag": "modus-wc-date",
202
+ "storyExample": {
203
+ "template": "<style>\n div[id^='story--components-forms-date--default'] {\n min-height: 400px;\n width: 300px;\n }\n </style>\n <modus-wc-date\n aria-label=\"Date input\"\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .feedback=${args.feedback}\n format=${ifDefined(args.format)}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n max=${ifDefined(args.max)}\n min=${ifDefined(args.min)}\n name=${ifDefined(args.name)}\n placeholder=${ifDefined(args.placeholder)}\n ?read-only=${args['read-only']}\n ?required=${args.required}\n ?show-week-numbers=${args['show-week-numbers']}\n size=${ifDefined(args.size)}\n .value=${args.value}\n week-start-day=${ifDefined(args['week-start-day'])}\n ></modus-wc-date>",
204
+ "args": {
205
+ "bordered": "true",
206
+ "custom-class": "''",
207
+ "disabled": "false",
208
+ "label": "'Label'",
209
+ "read-only": "false",
210
+ "required": "false",
211
+ "show-week-numbers": "false",
212
+ "size": "'md'",
213
+ "value": "''",
214
+ "week-start-day": "'sunday'"
215
+ },
216
+ "argTypes": {},
217
+ "events": [
218
+ "inputBlur",
219
+ "inputChange",
220
+ "inputFocus",
221
+ "calendarMonthChange",
222
+ "calendarYearChange",
223
+ ""
224
+ ],
225
+ "fullContent": "import { withActions } from '@storybook/addon-actions/decorator';\nimport { Meta, StoryObj } from '@storybook/web-components';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createShadowHostClass } from '../../providers/shadow-dom/shadow-host-helper';\nimport { IInputFeedbackProp, ModusSize } from '../types';\nimport { WeekStartDay } from '../types';\n\ninterface DateArgs {\n bordered?: boolean;\n 'custom-class'?: string;\n disabled?: boolean;\n feedback?: IInputFeedbackProp;\n format?:\n | 'yyyy-mm-dd'\n | 'dd-mm-yyyy'\n | 'mm-dd-yyyy'\n | 'MMM DD, YYYY'\n | 'yyyy/mm/dd'\n | 'dd/mm/yyyy'\n | 'mm/dd/yyyy';\n 'input-id'?: string;\n 'input-tab-index'?: number;\n label?: string;\n max?: string;\n min?: string;\n name?: string;\n placeholder?: string;\n 'read-only'?: boolean;\n required?: boolean;\n 'show-week-numbers'?: boolean;\n size?: ModusSize;\n value: string;\n 'week-start-day'?: WeekStartDay;\n}\n\nconst meta: Meta<DateArgs> = {\n title: 'Components/Forms/Date',\n component: 'modus-wc-date',\n args: {\n bordered: true,\n 'custom-class': '',\n disabled: false,\n label: 'Label',\n 'read-only': false,\n required: false,\n 'show-week-numbers': false,\n size: 'md',\n value: '',\n 'week-start-day': 'sunday',\n },\n argTypes: {\n feedback: {\n description: 'Feedback prop for input components',\n table: {\n type: {\n detail: `\n Interface: IInputFeedbackProp\n Properties:\n - level ('error' | 'info' | 'success' | 'warning'): The feedback level\n - message (string, optional): The feedback message\n `,\n },\n },\n },\n size: {\n control: { type: 'select' },\n options: ['sm', 'md', 'lg'],\n },\n format: {\n control: { type: 'select' },\n options: [\n 'yyyy-mm-dd',\n 'dd-mm-yyyy',\n 'mm-dd-yyyy',\n 'MMM DD, YYYY',\n 'yyyy/mm/dd',\n 'dd/mm/yyyy',\n 'mm/dd/yyyy',\n ],\n },\n 'week-start-day': {\n control: { type: 'select' },\n options: [\n 'sunday',\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n ],\n },\n },\n decorators: [withActions],\n parameters: {\n actions: {\n handles: [\n 'inputBlur',\n 'inputChange',\n 'inputFocus',\n 'calendarMonthChange',\n 'calendarYearChange',\n ],\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<DateArgs>;\n\nconst Template: Story = {\n render: (args) => {\n return html`\n <style>\n div[id^='story--components-forms-date--default'] {\n min-height: 400px;\n width: 300px;\n }\n </style>\n <modus-wc-date\n aria-label=\"Date input\"\n ?bordered=${args.bordered}\n custom-class=${ifDefined(args['custom-class'])}\n ?disabled=${args.disabled}\n .feedback=${args.feedback}\n format=${ifDefined(args.format)}\n input-id=${ifDefined(args['input-id'])}\n input-tab-index=${ifDefined(args['input-tab-index'])}\n label=${ifDefined(args.label)}\n max=${ifDefined(args.max)}\n min=${ifDefined(args.min)}\n name=${ifDefined(args.name)}\n placeholder=${ifDefined(args.placeholder)}\n ?read-only=${args['read-only']}\n ?required=${args.required}\n ?show-week-numbers=${args['show-week-numbers']}\n size=${ifDefined(args.size)}\n .value=${args.value}\n week-start-day=${ifDefined(args['week-start-day'])}\n ></modus-wc-date>\n `;\n },\n};\n\nexport const Default: Story = { ...Template };\n\nconst errorFeedback: IInputFeedbackProp = {\n level: 'error',\n message: 'Value is required.',\n};\n\nexport const WithErrorFeedback: Story = {\n ...Template,\n args: { feedback: errorFeedback, required: true },\n parameters: {\n docs: {\n source: {\n transform: (src) => `${src}\n<script>\n const dateInputElement = document.querySelector('modus-wc-date');\n dateInputElement.feedback = {\n level: 'error',\n message: 'Value is required.'\n };\n</script>`,\n },\n },\n },\n};\n\nexport const ShadowDomParent: Story = {\n render: (args) => {\n // Create a unique shadow host for date component\n if (!customElements.get('date-shadow-host')) {\n const DateShadowHost = createShadowHostClass<DateArgs>({\n componentTag: 'modus-wc-date',\n propsMapper: (v: DateArgs, el: HTMLElement) => {\n const dateEl = el as unknown as {\n bordered: boolean;\n customClass: string;\n disabled: boolean;\n feedback: IInputFeedbackProp;\n format: string;\n inputId: string;\n inputTabIndex: number;\n label: string;\n max: string;\n min: string;\n name: string;\n placeholder: string;\n readOnly: boolean;\n required: boolean;\n showWeekNumbers: boolean;\n size: string;\n value: string;\n weekStartDay: string;\n };\n dateEl.bordered = Boolean(v.bordered);\n dateEl.customClass = v['custom-class'] || '';\n dateEl.disabled = Boolean(v.disabled);\n dateEl.format = v.format ?? '';\n dateEl.inputId = v['input-id'] ?? '';\n dateEl.inputTabIndex = v['input-tab-index'] ?? -1;\n dateEl.label = v.label ?? '';\n dateEl.max = v.max ?? '';\n dateEl.min = v.min ?? '';\n dateEl.name = v.name ?? '';\n dateEl.placeholder = v.placeholder ?? '';\n dateEl.readOnly = Boolean(v['read-only']);\n dateEl.required = Boolean(v.required);\n dateEl.showWeekNumbers = Boolean(v['show-week-numbers']);\n dateEl.size = v.size ?? '';\n dateEl.value = v.value ?? '';\n dateEl.weekStartDay = v['week-start-day'] ?? '';\n },\n });\n customElements.define('date-shadow-host', DateShadowHost);\n }\n\n return html`<date-shadow-host .props=${{ ...args }}></date-shadow-host>`;\n },\n};\n\nexport const Migration: Story = {\n parameters: {\n docs: {\n description: {\n story: `\n#### Breaking Changes\n\n - In 1.0 input state was maintained by the component. 2.0 components encourage users to follow a controlled\n input model. See the Form Inputs [documentation]([Angular](?path=/docs/documentation-form-inputs--docs) for\n additional info and examples.\n - Size values have changed from verbose names (\\`medium\\`, \\`large\\`) to abbreviations (\\`sm\\`, \\`md\\`, \\`lg\\`).\n\n#### Prop Mapping\n\n| 1.0 Prop | 2.0 Prop | Notes |\n|--------------------|------------------|-----------------------------------------|\n| allow-chars-regex | | Not carried over |\n| alt-formats | | Not carried over |\n| aria-label | aria-label | |\n| auto-focus-input | | Not carried over |\n| disabled | disabled | |\n| disable-validation | | Not carried over |\n| error-text | feedback.message | Use \\`feedback\\` level |\n| filler-date | | Not carried over |\n| format | format | |\n| helper-text | | Not carried over |\n| label | label | |\n| max | max | |\n| min | min | |\n| placeholder | | Not carried over |\n| read-only | read-only | |\n| required | required | |\n| show-calendar-icon | | Not carried over |\n| size | size | \\`medium\\` → \\`md\\`, \\`large\\` → \\`lg\\` |\n| type | | Not carried over |\n| valid-text | feedback.message | Use \\`feedback\\` level |\n| value | value | |\n\n#### Event Mapping\n\n| 1.0 Event | 2.0 Event | Notes |\n|---------------------|-------------|------------------|\n| calendarIconClicked | | Not carried over |\n| dateInputBlur | inputBlur | |\n| valueChange | inputChange | |\n| valueError | | Not carried over |\n `,\n },\n },\n controls: { disable: true },\n canvas: { disable: true },\n },\n render: () => html`<div></div>`,\n};\n"
226
+ }
227
+ }