@public-ui/sample-react 2.1.7 → 2.1.8

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 (160) hide show
  1. package/dist/1487.js +1 -1
  2. package/dist/1636.js +1 -1
  3. package/dist/1792.js +1 -1
  4. package/dist/1795.js +1 -1
  5. package/dist/2017.js +1 -1
  6. package/dist/2322.js +1 -1
  7. package/dist/2538.js +1 -1
  8. package/dist/2567.js +1 -1
  9. package/dist/263.js +1 -1
  10. package/dist/2719.js +1 -1
  11. package/dist/3064.js +1 -1
  12. package/dist/3077.js +1 -1
  13. package/dist/3238.js +1 -1
  14. package/dist/3301.js +2 -0
  15. package/dist/3395.js +1 -1
  16. package/dist/35.js +1 -1
  17. package/dist/3521.js +1 -1
  18. package/dist/356.js +1 -1
  19. package/dist/3714.js +1 -1
  20. package/dist/3735.js +1 -1
  21. package/dist/3766.js +1 -1
  22. package/dist/3994.js +1 -1
  23. package/dist/4025.js +1 -1
  24. package/dist/4065.js +2 -0
  25. package/dist/4118.js +1 -1
  26. package/dist/4182.js +1 -1
  27. package/dist/4188.js +1 -1
  28. package/dist/4332.js +1 -1
  29. package/dist/4402.js +1 -1
  30. package/dist/4795.js +2 -0
  31. package/dist/4818.js +1 -1
  32. package/dist/4892.js +1 -1
  33. package/dist/4933.js +1 -1
  34. package/dist/4943.js +1 -1
  35. package/dist/495.js +1 -1
  36. package/dist/5034.js +1 -1
  37. package/dist/5056.js +1 -1
  38. package/dist/5138.js +1 -1
  39. package/dist/5296.js +1 -1
  40. package/dist/5356.js +1 -1
  41. package/dist/5551.js +1 -1
  42. package/dist/5835.js +1 -1
  43. package/dist/5840.js +1 -1
  44. package/dist/5889.js +1 -1
  45. package/dist/5912.js +1 -1
  46. package/dist/6082.js +1 -1
  47. package/dist/6099.js +1 -1
  48. package/dist/6181.js +1 -1
  49. package/dist/619.js +1 -1
  50. package/dist/6671.js +1 -1
  51. package/dist/6775.js +1 -1
  52. package/dist/7274.js +1 -1
  53. package/dist/7440.js +2 -0
  54. package/dist/7795.js +1 -1
  55. package/dist/7802.js +1 -1
  56. package/dist/7860.js +1 -1
  57. package/dist/8092.js +1 -1
  58. package/dist/8111.js +1 -1
  59. package/dist/8146.js +1 -1
  60. package/dist/8427.js +1 -1
  61. package/dist/8495.js +1 -1
  62. package/dist/8672.js +1 -1
  63. package/dist/8737.js +1 -1
  64. package/dist/8786.js +1 -1
  65. package/dist/8796.js +1 -1
  66. package/dist/8977.js +1 -1
  67. package/dist/9333.js +1 -1
  68. package/dist/9389.js +1 -1
  69. package/dist/9561.js +1 -1
  70. package/dist/9599.js +1 -1
  71. package/dist/9612.js +1 -1
  72. package/dist/9890.js +1 -1
  73. package/dist/index.html +1 -1
  74. package/dist/main.css +3 -3
  75. package/dist/main.js +1 -1
  76. package/dist/main.js.LICENSE.txt +2 -2
  77. package/package.json +16 -16
  78. package/public/index.html +1 -1
  79. package/src/@shared/_mixins.scss +3 -0
  80. package/src/App.tsx +1 -1
  81. package/src/components/FormWrap.tsx +1 -1
  82. package/src/components/Navigation.tsx +63 -0
  83. package/src/components/Sidebar.tsx +5 -41
  84. package/src/components/abbr/basic.tsx +12 -12
  85. package/src/components/alert/card-msg.tsx +3 -1
  86. package/src/components/alert/html.tsx +4 -2
  87. package/src/components/button/access-key.tsx +34 -25
  88. package/src/components/button/aria-description.tsx +20 -11
  89. package/src/components/button/baselined.tsx +22 -13
  90. package/src/components/button/icons.tsx +33 -26
  91. package/src/components/button/partials/cases.tsx +13 -6
  92. package/src/components/button/partials/variants.tsx +15 -17
  93. package/src/components/button/width.tsx +33 -28
  94. package/src/components/button-group/basic.tsx +25 -16
  95. package/src/components/button-link/basic.tsx +3 -3
  96. package/src/components/button-link/image.tsx +0 -1
  97. package/src/components/card/basic.tsx +1 -1
  98. package/src/components/combobox/partials/variants.tsx +1 -1
  99. package/src/components/details/basic.tsx +2 -2
  100. package/src/components/form/basic.tsx +1 -1
  101. package/src/components/form/error-list.tsx +1 -0
  102. package/src/components/handout/basic.tsx +304 -279
  103. package/src/components/input-checkbox/partials/variants.tsx +22 -10
  104. package/src/components/input-date/reset.tsx +1 -1
  105. package/src/components/input-password/show-password.tsx +1 -1
  106. package/src/components/input-text/partials/cases.tsx +1 -1
  107. package/src/components/input-text/routes.ts +2 -0
  108. package/src/components/input-text/smart-button.tsx +33 -0
  109. package/src/components/input-text/text-formatter.tsx +98 -45
  110. package/src/components/link/image.tsx +0 -1
  111. package/src/components/link/target.tsx +1 -1
  112. package/src/components/modal/basic.tsx +1 -1
  113. package/src/components/nav/basic.tsx +23 -12
  114. package/src/components/nav/horizontal.tsx +12 -3
  115. package/src/components/nav/links.ts +36 -0
  116. package/src/components/table/column-alignment.tsx +64 -62
  117. package/src/components/table/complex-headers.tsx +80 -78
  118. package/src/components/table/horizontal-scrollbar.tsx +30 -28
  119. package/src/components/table/interactive-child-elements.tsx +81 -69
  120. package/src/components/table/pagination-position.tsx +15 -13
  121. package/src/components/table/render-cell.tsx +14 -3
  122. package/src/components/table/sort-data.tsx +11 -8
  123. package/src/components/table/stateful-with-selection.tsx +47 -27
  124. package/src/components/table/stateful-with-single-selection.tsx +47 -27
  125. package/src/components/table/stateless-with-selection.tsx +37 -17
  126. package/src/components/table/stateless-with-single-selection.tsx +37 -17
  127. package/src/components/table/stateless.tsx +29 -27
  128. package/src/components/table/with-footer.tsx +1 -0
  129. package/src/components/table/with-pagination.tsx +1 -1
  130. package/src/components/tabs/behavior.tsx +61 -0
  131. package/src/components/tabs/routes.ts +2 -0
  132. package/src/components/textarea/adjust-height.tsx +1 -1
  133. package/src/components/textarea/counter.tsx +4 -1
  134. package/src/components/textarea/resize.tsx +1 -1
  135. package/src/components/textarea/rows.tsx +1 -1
  136. package/src/components/toast/basic.tsx +13 -11
  137. package/src/hooks/useToasterService.ts +21 -0
  138. package/src/react.main.tsx +6 -1
  139. package/src/scenarios/appointment-form/AppointmentForm.tsx +1 -0
  140. package/src/scenarios/custom-tooltip-width.tsx +26 -11
  141. package/src/scenarios/disabled-interactive-elements.tsx +123 -114
  142. package/src/scenarios/focus-elements.tsx +21 -16
  143. package/src/scenarios/horizontal-scrollbar-advanced/TableHorizontalScrollbarAdvanced.tsx +1 -1
  144. package/src/scenarios/horizontal-scrollbar-advanced/layout.scss +19 -0
  145. package/src/scenarios/input-group-with-error.tsx +41 -0
  146. package/src/scenarios/inputs-get-value.tsx +121 -119
  147. package/src/scenarios/routes.ts +4 -2
  148. package/src/scenarios/static-form.tsx +65 -62
  149. package/src/style.scss +10 -13
  150. package/tsconfig.json +1 -2
  151. package/unocss.config.ts +213 -0
  152. package/dist/3171.js +0 -2
  153. package/dist/4262.js +0 -2
  154. package/dist/479.js +0 -2
  155. package/dist/8710.js +0 -2
  156. package/src/scenarios/horizontal-scrollbar-advanced/layout.css +0 -31
  157. /package/dist/{3171.js.LICENSE.txt → 3301.js.LICENSE.txt} +0 -0
  158. /package/dist/{4262.js.LICENSE.txt → 4065.js.LICENSE.txt} +0 -0
  159. /package/dist/{479.js.LICENSE.txt → 4795.js.LICENSE.txt} +0 -0
  160. /package/dist/{8710.js.LICENSE.txt → 7440.js.LICENSE.txt} +0 -0
@@ -22,6 +22,7 @@ import {
22
22
  import type { FC } from 'react';
23
23
  import React from 'react';
24
24
  import { SampleDescription } from '../components/SampleDescription';
25
+ import { useToasterService } from '../hooks/useToasterService';
25
26
 
26
27
  const OPTIONS = [
27
28
  {
@@ -34,87 +35,113 @@ const OPTIONS = [
34
35
  },
35
36
  ];
36
37
 
37
- export const DisabledInteractiveElements: FC = () => (
38
- <>
39
- <SampleDescription>
40
- <p>This example shows how deactivated interactive elements are displayed.</p>
41
- <ul>
42
- <li>Deactivated interactive elements pose a particular challenge for accessibility.</li>
43
- <li>It must not be possible to focus on deactivated interactive elements, otherwise the tab paths will be unnecessarily extended.</li>
44
- <li>Deactivated interactive elements should be labelled clearly and legibly.</li>
45
- <li>
46
- Deactivated interactive elements have a tooltip for sighted people and aria labelling for the screen readers reading mode if they are represented by
47
- an interpretable graphic.
48
- </li>
49
- </ul>
50
- <p>This implementation ensures standardized use for all users.</p>
51
- </SampleDescription>
38
+ export const DisabledInteractiveElements: FC = () => {
39
+ const { dummyClickEventHandler } = useToasterService();
52
40
 
53
- <div className="grid gap-4">
54
- <KolCard _label="Button" _level={0}>
55
- <div className="flex flex-wrap gap-4">
56
- <KolButton _label="Label" />
57
- <KolButton _disabled _label="Label" />
58
- <KolButton _hideLabel _icons="codicon codicon-home" _label="Label" />
59
- <KolButton _disabled _hideLabel _icons="codicon codicon-home" _label="Label" />
60
- </div>
61
- </KolCard>
62
- <KolCard _label="ButtonLink" _level={0}>
63
- <div className="flex flex-wrap gap-4">
64
- <KolButtonLink _label="Label" />
65
- <KolButtonLink _disabled _label="Label" />
66
- <KolButtonLink _hideLabel _icons="codicon codicon-home" _label="Label" />
67
- <KolButtonLink _hideLabel _icons="codicon codicon-home" _disabled _label="Label" />
68
- </div>
69
- </KolCard>
70
- <KolCard _label="Link" _level={0}>
71
- <div className="flex flex-wrap gap-4">
72
- <KolLink _href="#" _label="Label" />
73
- <KolLink _disabled _href="#" _label="Label" />
74
- <KolLink _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
75
- <KolLink _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
76
- </div>
77
- </KolCard>
78
- <KolCard _label="LinkButton" _level={0}>
79
- <div className="flex flex-wrap gap-4">
80
- <KolLinkButton _href="#" _label="Label" />
81
- <KolLinkButton _disabled _href="#" _label="Label" />
82
- <KolLinkButton _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
83
- <KolLinkButton _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
84
- </div>
85
- </KolCard>
86
- <KolCard _label="Accordion" _level={0}>
87
- <div className="grid gap-4">
88
- <KolAccordion _label="Label">Content</KolAccordion>
89
- <KolAccordion _disabled _label="Label">
90
- Content
91
- </KolAccordion>
92
- <KolAccordion _label="Label (open)" _open>
93
- Content
94
- </KolAccordion>
95
- <KolAccordion _disabled _label="Label (open)" _open>
96
- Content
97
- </KolAccordion>
98
- </div>
99
- </KolCard>
100
- <KolCard _label="Details" _level={0}>
101
- <div className="grid gap-4">
102
- <KolDetails _label="Label">Content</KolDetails>
103
- <KolDetails _disabled _label="Label">
104
- Content
105
- </KolDetails>
106
- <KolDetails _label="Label (open)" _open>
107
- Content
108
- </KolDetails>
109
- <KolDetails _disabled _label="Label (open)" _open>
110
- Content
111
- </KolDetails>
112
- </div>
113
- </KolCard>
114
- {[KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRange, KolInputText].map(
115
- (Input) => {
41
+ const dummyEventHandler = {
42
+ onClick: dummyClickEventHandler,
43
+ };
44
+
45
+ return (
46
+ <>
47
+ <SampleDescription>
48
+ <p>This example shows how deactivated interactive elements are displayed.</p>
49
+ <ul>
50
+ <li>Deactivated interactive elements pose a particular challenge for accessibility.</li>
51
+ <li>It must not be possible to focus on deactivated interactive elements, otherwise the tab paths will be unnecessarily extended.</li>
52
+ <li>Deactivated interactive elements should be labelled clearly and legibly.</li>
53
+ <li>
54
+ Deactivated interactive elements have a tooltip for sighted people and aria labelling for the screen readers reading mode if they are represented by
55
+ an interpretable graphic.
56
+ </li>
57
+ </ul>
58
+ <p>This implementation ensures standardized use for all users.</p>
59
+ </SampleDescription>
60
+
61
+ <div className="w-full grid gap-4">
62
+ <KolCard _label="Button" _level={0}>
63
+ <div className="flex flex-wrap gap-4">
64
+ <KolButton _label="Label" _on={dummyEventHandler} />
65
+ <KolButton _disabled _label="Label" _on={dummyEventHandler} />
66
+ <KolButton _hideLabel _icons="codicon codicon-home" _label="Label" _on={dummyEventHandler} />
67
+ <KolButton _disabled _hideLabel _icons="codicon codicon-home" _label="Label" _on={dummyEventHandler} />
68
+ </div>
69
+ </KolCard>
70
+ <KolCard _label="ButtonLink" _level={0}>
71
+ <div className="flex flex-wrap gap-4">
72
+ <KolButtonLink _label="Label" />
73
+ <KolButtonLink _disabled _label="Label" />
74
+ <KolButtonLink _hideLabel _icons="codicon codicon-home" _label="Label" />
75
+ <KolButtonLink _hideLabel _icons="codicon codicon-home" _disabled _label="Label" />
76
+ </div>
77
+ </KolCard>
78
+ <KolCard _label="Link" _level={0}>
79
+ <div className="flex flex-wrap gap-4">
80
+ <KolLink _href="#" _label="Label" />
81
+ <KolLink _disabled _href="#" _label="Label" />
82
+ <KolLink _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
83
+ <KolLink _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
84
+ </div>
85
+ </KolCard>
86
+ <KolCard _label="LinkButton" _level={0}>
87
+ <div className="flex flex-wrap gap-4">
88
+ <KolLinkButton _href="#" _label="Label" />
89
+ <KolLinkButton _disabled _href="#" _label="Label" />
90
+ <KolLinkButton _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
91
+ <KolLinkButton _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
92
+ </div>
93
+ </KolCard>
94
+ <KolCard _label="Accordion" _level={0}>
95
+ <div className="grid gap-4">
96
+ <KolAccordion _label="Label">Content</KolAccordion>
97
+ <KolAccordion _disabled _label="Label">
98
+ Content
99
+ </KolAccordion>
100
+ <KolAccordion _label="Label (open)" _open>
101
+ Content
102
+ </KolAccordion>
103
+ <KolAccordion _disabled _label="Label (open)" _open>
104
+ Content
105
+ </KolAccordion>
106
+ </div>
107
+ </KolCard>
108
+ <KolCard _label="Details" _level={0}>
109
+ <div className="grid gap-4">
110
+ <KolDetails _label="Label">Content</KolDetails>
111
+ <KolDetails _disabled _label="Label">
112
+ Content
113
+ </KolDetails>
114
+ <KolDetails _label="Label (open)" _open>
115
+ Content
116
+ </KolDetails>
117
+ <KolDetails _disabled _label="Label (open)" _open>
118
+ Content
119
+ </KolDetails>
120
+ </div>
121
+ </KolCard>
122
+ {[KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRange, KolInputText].map(
123
+ (Input) => {
124
+ const render = (
125
+ Input as typeof KolInputCheckbox & {
126
+ render: { displayName: string };
127
+ }
128
+ ).render;
129
+ const name = render.displayName;
130
+ return (
131
+ <KolCard key={name} _label={name} _level={0}>
132
+ <div className="grid gap-4">
133
+ <Input _label="Label" />
134
+ <Input _disabled _label="Label" />
135
+ <Input _hideLabel _label="Label" />
136
+ <Input _disabled _hideLabel _label="Label" />
137
+ </div>
138
+ </KolCard>
139
+ );
140
+ },
141
+ )}
142
+ {[KolInputRadio, KolSelect].map((Input) => {
116
143
  const render = (
117
- Input as typeof KolInputCheckbox & {
144
+ Input as typeof KolInputRadio & {
118
145
  render: { displayName: string };
119
146
  }
120
147
  ).render;
@@ -122,41 +149,23 @@ export const DisabledInteractiveElements: FC = () => (
122
149
  return (
123
150
  <KolCard key={name} _label={name} _level={0}>
124
151
  <div className="grid gap-4">
125
- <Input _label="Label" />
126
- <Input _disabled _label="Label" />
127
- <Input _hideLabel _label="Label" />
128
- <Input _disabled _hideLabel _label="Label" />
152
+ <Input _label="Label" _options={OPTIONS} />
153
+ <Input _disabled _label="Label" _options={OPTIONS} />
154
+ <Input _hideLabel _label="Label" _options={OPTIONS} />
155
+ <Input _disabled _hideLabel _label="Label" _options={OPTIONS} />
129
156
  </div>
130
157
  </KolCard>
131
158
  );
132
- },
133
- )}
134
- {[KolInputRadio, KolSelect].map((Input) => {
135
- const render = (
136
- Input as typeof KolInputRadio & {
137
- render: { displayName: string };
138
- }
139
- ).render;
140
- const name = render.displayName;
141
- return (
142
- <KolCard key={name} _label={name} _level={0}>
143
- <div className="grid gap-4">
144
- <Input _label="Label" _options={OPTIONS} />
145
- <Input _disabled _label="Label" _options={OPTIONS} />
146
- <Input _hideLabel _label="Label" _options={OPTIONS} />
147
- <Input _disabled _hideLabel _label="Label" _options={OPTIONS} />
148
- </div>
149
- </KolCard>
150
- );
151
- })}
152
- <KolCard _label="KolTextarea" _level={0}>
153
- <div className="grid gap-4">
154
- <KolTextarea _label="Label" _rows={3} />
155
- <KolTextarea _disabled _label="Label" _rows={3} />
156
- <KolTextarea _hideLabel _label="Label" _rows={3} />
157
- <KolTextarea _disabled _hideLabel _label="Label" _rows={3} />
158
- </div>
159
- </KolCard>
160
- </div>
161
- </>
162
- );
159
+ })}
160
+ <KolCard _label="KolTextarea" _level={0}>
161
+ <div className="grid gap-4">
162
+ <KolTextarea _label="Label" _rows={3} />
163
+ <KolTextarea _disabled _label="Label" _rows={3} />
164
+ <KolTextarea _hideLabel _label="Label" _rows={3} />
165
+ <KolTextarea _disabled _hideLabel _label="Label" _rows={3} />
166
+ </div>
167
+ </KolCard>
168
+ </div>
169
+ </>
170
+ );
171
+ };
@@ -5,6 +5,7 @@ import {
5
5
  KolButtonLink,
6
6
  KolCombobox,
7
7
  KolDetails,
8
+ KolHeading,
8
9
  KolInputCheckbox,
9
10
  KolInputColor,
10
11
  KolInputDate,
@@ -30,16 +31,17 @@ import type { FocusableElement } from '@public-ui/components';
30
31
 
31
32
  const getFocusElements = () => {
32
33
  const focusElements = new Map<string, ForwardRefRenderFunction<any, any>>();
33
- focusElements.set('inputCheckbox', (_, ref) => <KolInputCheckbox _name="checkbox" _label="Checkbox" ref={ref} />);
34
- focusElements.set('inputColor', (_, ref) => <KolInputColor _name="color" _label="Color" ref={ref} />);
35
- focusElements.set('inputDate', (_, ref) => <KolInputDate _name="date" _label="Date" ref={ref} />);
36
- focusElements.set('inputEmail', (_, ref) => <KolInputEmail _name="email" _label="Email" ref={ref} />);
37
- focusElements.set('inputFile', (_, ref) => <KolInputFile _name="file" _label="File" ref={ref} />);
38
- focusElements.set('inputFileMultiple', (_, ref) => <KolInputFile _name="file" _label="Files (multiple)" _multiple ref={ref} />);
39
- focusElements.set('inputNumber', (_, ref) => <KolInputNumber _name="number" _label="Number" ref={ref} />);
40
- focusElements.set('inputPassword', (_, ref) => <KolInputPassword _name="password" _label="Password" ref={ref} />);
34
+ focusElements.set('inputCheckbox', (_, ref) => <KolInputCheckbox className="w-full" _name="checkbox" _label="Checkbox" ref={ref} />);
35
+ focusElements.set('inputColor', (_, ref) => <KolInputColor className="w-full" _name="color" _label="Color" ref={ref} />);
36
+ focusElements.set('inputDate', (_, ref) => <KolInputDate className="w-full" _name="date" _label="Date" ref={ref} />);
37
+ focusElements.set('inputEmail', (_, ref) => <KolInputEmail className="w-full" _name="email" _label="Email" ref={ref} />);
38
+ focusElements.set('inputFile', (_, ref) => <KolInputFile className="w-full" _name="file" _label="File" ref={ref} />);
39
+ focusElements.set('inputFileMultiple', (_, ref) => <KolInputFile className="w-full" _name="file" _label="Files (multiple)" _multiple ref={ref} />);
40
+ focusElements.set('inputNumber', (_, ref) => <KolInputNumber className="w-full" _name="number" _label="Number" ref={ref} />);
41
+ focusElements.set('inputPassword', (_, ref) => <KolInputPassword className="w-full" _name="password" _label="Password" ref={ref} />);
41
42
  focusElements.set('inputRadio', (_, ref) => (
42
43
  <KolInputRadio
44
+ className="w-full"
43
45
  _name="radio"
44
46
  _label="Radio"
45
47
  _options={[
@@ -50,10 +52,11 @@ const getFocusElements = () => {
50
52
  ref={ref}
51
53
  />
52
54
  ));
53
- focusElements.set('inputRange', (_, ref) => <KolInputRange _name="range" _label="Range" ref={ref} />);
54
- focusElements.set('inputText', (_, ref) => <KolInputText _name="text" _label="Text" ref={ref} />);
55
+ focusElements.set('inputRange', (_, ref) => <KolInputRange className="w-full" _name="range" _label="Range" ref={ref} />);
56
+ focusElements.set('inputText', (_, ref) => <KolInputText className="w-full" _name="text" _label="Text" ref={ref} />);
55
57
  focusElements.set('select', (_, ref) => (
56
58
  <KolSelect
59
+ className="w-full"
57
60
  _name="select"
58
61
  _label="Select"
59
62
  _options={[
@@ -65,6 +68,7 @@ const getFocusElements = () => {
65
68
  ));
66
69
  focusElements.set('selectMultiple', (_, ref) => (
67
70
  <KolSelect
71
+ className="w-full"
68
72
  _name="select"
69
73
  _label="Select (multiple)"
70
74
  _multiple
@@ -78,6 +82,7 @@ const getFocusElements = () => {
78
82
  ));
79
83
  focusElements.set('singleSelect', (_, ref) => (
80
84
  <KolSingleSelect
85
+ className="w-full"
81
86
  _name="singleSelect"
82
87
  _label="Single Select"
83
88
  _options={[
@@ -87,17 +92,17 @@ const getFocusElements = () => {
87
92
  ref={ref}
88
93
  />
89
94
  ));
90
- focusElements.set('textarea', (_, ref) => <KolTextarea _name="textarea" _label="Textarea" _rows={5} ref={ref} />);
91
- focusElements.set('accordion', (_, ref) => <KolAccordion _label="Accordion here" ref={ref} />);
95
+ focusElements.set('textarea', (_, ref) => <KolTextarea className="w-full" _name="textarea" _label="Textarea" _rows={5} ref={ref} />);
96
+ focusElements.set('accordion', (_, ref) => <KolAccordion className="w-full" _label="Accordion here" ref={ref} />);
92
97
  focusElements.set('button', (_, ref) => <KolButton _label="Button here" ref={ref}></KolButton>);
93
98
  focusElements.set('buttonLink', (_, ref) => <KolButtonLink _label="ButtonLink here" ref={ref}></KolButtonLink>);
94
- focusElements.set('combobox', (_, ref) => <KolCombobox _label="KolCombobox here" _suggestions={[]} ref={ref}></KolCombobox>);
99
+ focusElements.set('combobox', (_, ref) => <KolCombobox className="w-full" _label="KolCombobox here" _suggestions={[]} ref={ref}></KolCombobox>);
95
100
  focusElements.set('details', (_, ref) => (
96
- <KolDetails _label="Details here" ref={ref}>
101
+ <KolDetails className="w-full" _label="Details here" ref={ref}>
97
102
  detailed details
98
103
  </KolDetails>
99
104
  ));
100
- focusElements.set('link', (_, ref) => <KolLink _label="Link here" _href="#" ref={ref}></KolLink>);
105
+ focusElements.set('link', (_, ref) => <KolLink className="w-full" _label="Link here" _href="#" ref={ref}></KolLink>);
101
106
  focusElements.set('linkButton', (_, ref) => <KolLinkButton _label="LinkButton here" _href="#" ref={ref}></KolLinkButton>);
102
107
 
103
108
  return focusElements;
@@ -125,7 +130,7 @@ const Fallback = (props: FallbackProps) => {
125
130
  </KolAlert>
126
131
  )}
127
132
 
128
- <h4>Focus Test Cases</h4>
133
+ <KolHeading _level={2} _label="Focus Test Cases" />
129
134
  <ul>
130
135
  {componentNames.map((componentName) => (
131
136
  <li key={componentName}>
@@ -5,7 +5,7 @@ import { SampleDescription } from '../../components/SampleDescription';
5
5
  import { LINKS } from '../../components/nav/links';
6
6
  import DATA from './databasedata.json';
7
7
 
8
- import './layout.css';
8
+ import './layout.scss';
9
9
 
10
10
  const TABS: TabButtonProps[] = [
11
11
  {
@@ -0,0 +1,19 @@
1
+ @import '../../@shared/mixins';
2
+
3
+ .mainlayout {
4
+ min-height: calc(100vh - rem(32));
5
+ width: 100%;
6
+ display: grid;
7
+ column-gap: rem(16);
8
+ grid-template-columns: rem(400) calc(100% - rem(460));
9
+ grid-template-rows: 1fr;
10
+ grid-template-areas: 'nav content';
11
+
12
+ & > .nav-area {
13
+ grid-area: nav;
14
+ }
15
+
16
+ & > .content {
17
+ grid-area: content;
18
+ }
19
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import type { FC } from 'react';
3
+ import { KolAlert, KolInputCheckbox, KolInputText } from '@public-ui/react';
4
+ import { SampleDescription } from '../components/SampleDescription';
5
+
6
+ export const InputGroupWithError: FC = () => {
7
+ const phoneError = true;
8
+ const phoneErrorMessage = 'Unrecognized phone number.';
9
+ const pizzaError = true;
10
+ const pizzaErrorMessage = 'Choose at least two and up to five toppings.';
11
+ const pizzaToppings = ['Mushrooms', 'Bell Peppers', 'Onions', 'Olives', 'Spinach', 'Tomatoes', 'Artichokes', 'Zucchini', 'Jalapeños', 'Basil'];
12
+
13
+ return (
14
+ <>
15
+ <SampleDescription>
16
+ <p>This sample shows how input components can be grouped together with just one error message, without repeating the message for every field.</p>
17
+ <p>The sample only demonstrates how the errors can be displayed, an actual validation logic is not part of the example.</p>
18
+ </SampleDescription>
19
+
20
+ <fieldset>
21
+ <legend>Phone number</legend>
22
+ {phoneError && <KolAlert _alert _type="error" _label={phoneErrorMessage} />}
23
+
24
+ <div className="grid grid-cols-3 gap-4 max-w-2xl">
25
+ <KolInputText _label="Country code" _msg={{ _description: phoneErrorMessage, _type: 'error' }} _touched _hideError />
26
+ <KolInputText _label="Area code" _msg={{ _description: phoneErrorMessage, _type: 'error' }} _touched _hideError />
27
+ <KolInputText _label="Local number" _msg={{ _description: phoneErrorMessage, _type: 'error' }} _touched _hideError />
28
+ </div>
29
+ </fieldset>
30
+
31
+ <fieldset className="mt">
32
+ <legend>Pizza toppings</legend>
33
+ {pizzaError && <KolAlert _alert _type="error" _label={pizzaErrorMessage} />}
34
+
35
+ {pizzaToppings.map((topping) => (
36
+ <KolInputCheckbox key={topping} _label={topping} _msg={{ _description: phoneErrorMessage, _type: 'error' }} _touched _hideError />
37
+ ))}
38
+ </fieldset>
39
+ </>
40
+ );
41
+ };