@public-ui/sample-react 4.3.1-rc.1 → 4.3.1-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src/App.tsx +2 -0
- package/src/components/InputEventValueDemo.tsx +6 -3
- package/src/components/SampleBlock.tsx +81 -0
- package/src/components/SampleGroup.tsx +27 -0
- package/src/components/abbr/basic.tsx +6 -3
- package/src/components/accordion/basic.tsx +3 -2
- package/src/components/accordion/headlines.tsx +3 -2
- package/src/components/alert/basic.tsx +17 -14
- package/src/components/avatar/basic.tsx +3 -2
- package/src/components/avatar/size.tsx +3 -2
- package/src/components/badge/basic.tsx +48 -7
- package/src/components/badge/routes.ts +0 -4
- package/src/components/breadcrumb/basic.tsx +3 -2
- package/src/components/button/access-key.tsx +8 -10
- package/src/components/button/aria-description.tsx +4 -4
- package/src/components/button/baselined.tsx +4 -4
- package/src/components/button/basic.tsx +10 -17
- package/src/components/button/disabled.tsx +6 -7
- package/src/components/button/expert-slot.tsx +6 -7
- package/src/components/button/focus-options.tsx +8 -10
- package/src/components/button/hide-label.tsx +8 -10
- package/src/components/button/icons.tsx +12 -16
- package/src/components/button/row-reverse-tooltip.tsx +4 -4
- package/src/components/button/short-key.tsx +15 -20
- package/src/components/button/spinner.tsx +6 -7
- package/src/components/button/variants.tsx +6 -6
- package/src/components/button/width.tsx +6 -7
- package/src/components/button-link/aria-description.tsx +3 -2
- package/src/components/button-link/basic.tsx +37 -35
- package/src/components/button-link/icons.tsx +13 -2
- package/src/components/button-link/image.tsx +3 -2
- package/src/components/card/basic.tsx +3 -2
- package/src/components/card/headlines.tsx +3 -2
- package/src/components/card/linked.tsx +3 -2
- package/src/components/combobox/partials/cases.tsx +40 -14
- package/src/components/combobox/partials/variants.tsx +7 -8
- package/src/components/details/basic.tsx +3 -2
- package/src/components/form/basic.tsx +5 -4
- package/src/components/form/error-list-scroll.tsx +87 -0
- package/src/components/form/error-list.tsx +56 -56
- package/src/components/form/routes.ts +2 -0
- package/src/components/heading/badged.tsx +3 -2
- package/src/components/heading/basic.tsx +3 -2
- package/src/components/heading/paragraph.tsx +3 -2
- package/src/components/heading/secondary.tsx +3 -2
- package/src/components/icon/all-kolicons.tsx +1 -1
- package/src/components/icon/basic.tsx +6 -6
- package/src/components/icon/font.tsx +21 -13
- package/src/components/image/basic.tsx +8 -5
- package/src/components/input-checkbox/partials/cases.tsx +75 -14
- package/src/components/input-checkbox/partials/variants.tsx +13 -16
- package/src/components/input-color/partials/cases.tsx +61 -18
- package/src/components/input-color/partials/variants.tsx +7 -8
- package/src/components/input-date/partials/cases.tsx +70 -26
- package/src/components/input-date/partials/minMax.tsx +38 -11
- package/src/components/input-date/partials/variants.tsx +10 -12
- package/src/components/input-email/partials/cases.tsx +69 -30
- package/src/components/input-email/partials/variants.tsx +7 -8
- package/src/components/input-file/partials/cases.tsx +58 -24
- package/src/components/input-file/partials/variants.tsx +7 -8
- package/src/components/input-number/number-formatter.tsx +5 -4
- package/src/components/input-number/partials/cases.tsx +68 -28
- package/src/components/input-number/partials/variants.tsx +7 -8
- package/src/components/input-password/partials/cases.tsx +67 -30
- package/src/components/input-password/partials/variants.tsx +7 -8
- package/src/components/input-password/show-password.tsx +22 -19
- package/src/components/input-radio/horizontal.tsx +3 -2
- package/src/components/input-radio/objectValue.tsx +5 -4
- package/src/components/input-radio/partials/cases.tsx +85 -55
- package/src/components/input-radio/partials/variants.tsx +7 -9
- package/src/components/input-range/partials/cases.tsx +60 -23
- package/src/components/input-range/partials/variants.tsx +7 -8
- package/src/components/input-text/access-short-key.tsx +11 -4
- package/src/components/input-text/aria-details.tsx +3 -2
- package/src/components/input-text/background-test.tsx +7 -5
- package/src/components/input-text/basic.tsx +24 -5
- package/src/components/input-text/clear-button.tsx +26 -0
- package/src/components/input-text/counter.tsx +3 -2
- package/src/components/input-text/disabled.tsx +11 -4
- package/src/components/input-text/expert-slot.tsx +13 -8
- package/src/components/input-text/hide-label.tsx +7 -6
- package/src/components/input-text/hide-msg.tsx +5 -4
- package/src/components/input-text/message-types.tsx +13 -4
- package/src/components/input-text/msg-and-counter.tsx +9 -4
- package/src/components/input-text/pattern.tsx +18 -15
- package/src/components/input-text/placeholder.tsx +13 -4
- package/src/components/input-text/readonly.tsx +11 -4
- package/src/components/input-text/routes.ts +2 -0
- package/src/components/input-text/select-range.tsx +3 -2
- package/src/components/input-text/smart-button.tsx +7 -4
- package/src/components/input-text/text-formatter.tsx +5 -4
- package/src/components/input-text/variant.tsx +8 -6
- package/src/components/kolibri/basic.tsx +9 -6
- package/src/components/link/basic.tsx +3 -2
- package/src/components/link/icons.tsx +3 -2
- package/src/components/link/image.tsx +3 -2
- package/src/components/link/target.tsx +3 -2
- package/src/components/link/variant.tsx +5 -4
- package/src/components/link-button/aria-description.tsx +7 -1
- package/src/components/link-button/basic.tsx +5 -4
- package/src/components/link-button/routes.ts +2 -0
- package/src/components/link-button/target.tsx +19 -0
- package/src/components/meter/basic.tsx +4 -4
- package/src/components/meter/dynamic.tsx +4 -4
- package/src/components/meter/optimum.tsx +8 -10
- package/src/components/meter/orientation.tsx +6 -7
- package/src/components/nav/aria-current.tsx +18 -15
- package/src/components/nav/basic.tsx +8 -10
- package/src/components/pagination/basic.tsx +3 -2
- package/src/components/pagination/button-visibility.tsx +16 -11
- package/src/components/pagination/sibling-boundary.tsx +3 -2
- package/src/components/popover-button/inline.tsx +4 -5
- package/src/components/progress/basic.tsx +7 -6
- package/src/components/quote/basic.tsx +4 -1
- package/src/components/quote/block.tsx +9 -6
- package/src/components/select/partials/cases.tsx +73 -33
- package/src/components/select/partials/variants.tsx +7 -8
- package/src/components/single-select/partials/cases.tsx +148 -114
- package/src/components/single-select/partials/variants.tsx +7 -8
- package/src/components/spin/basic.tsx +34 -3
- package/src/components/spin/routes.ts +0 -8
- package/src/components/split-button/basic.tsx +3 -2
- package/src/components/table/action-columns.tsx +3 -2
- package/src/components/table/column-alignment.tsx +3 -2
- package/src/components/table/complex-headers.tsx +3 -2
- package/src/components/table/empty.tsx +31 -0
- package/src/components/table/horizontal-scrollbar.tsx +24 -19
- package/src/components/table/multi-sort.tsx +6 -7
- package/src/components/table/non-hidable-columns.tsx +18 -15
- package/src/components/table/pagination-position.tsx +8 -10
- package/src/components/table/routes.ts +4 -0
- package/src/components/table/sort-data.tsx +6 -7
- package/src/components/table/stateful-async.tsx +50 -0
- package/src/components/table/stateful-with-selection.tsx +3 -2
- package/src/components/table/stateful-with-single-selection.tsx +3 -2
- package/src/components/table/stateless-async-paging.tsx +9 -32
- package/src/components/table/stateless-with-selection.tsx +3 -2
- package/src/components/table/stateless-with-single-selection.tsx +3 -2
- package/src/components/table/stateless.tsx +3 -2
- package/src/components/table/sticky-col.tsx +12 -10
- package/src/components/table/sticky-header.tsx +12 -10
- package/src/components/table/variant.tsx +5 -4
- package/src/components/table/with-footer.tsx +73 -70
- package/src/components/table/with-pagination.tsx +3 -2
- package/src/components/tabs/basic.tsx +17 -12
- package/src/components/tabs/create-button.tsx +11 -8
- package/src/components/tabs/icons-only.tsx +9 -6
- package/src/components/textarea/adjust-height.tsx +6 -3
- package/src/components/textarea/partials/cases.tsx +63 -15
- package/src/components/textarea/partials/variants.tsx +7 -8
- package/src/components/textarea/resize.tsx +3 -2
- package/src/components/textarea/rows.tsx +6 -3
- package/src/components/textarea/with-counter.tsx +3 -2
- package/src/components/toolbar/basic.tsx +6 -5
- package/src/components/toolbar/disabled.tsx +41 -38
- package/src/components/tree/basic.tsx +32 -29
- package/src/components/version/basic.tsx +4 -1
- package/src/components/version/context.tsx +8 -5
- package/src/hooks/useVisualBlockOutline.ts +38 -0
- package/src/scenarios/button-shortkey-table.tsx +4 -4
- package/src/shares/store.ts +0 -4
- package/src/shares/visualBlockOutline.ts +75 -0
- package/src/components/badge/button.tsx +0 -35
- package/src/components/badge/formatted-label.tsx +0 -19
- package/src/components/spin/custom.tsx +0 -23
- package/src/components/spin/cycle.tsx +0 -16
- package/src/components/spin/label.tsx +0 -23
- package/src/components/spin/variables.tsx +0 -16
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonBasic: FC = () => {
|
|
@@ -21,9 +22,7 @@ export const ButtonBasic: FC = () => {
|
|
|
21
22
|
</SampleDescription>
|
|
22
23
|
|
|
23
24
|
<div className="grid gap-8">
|
|
24
|
-
|
|
25
|
-
<section className="grid gap-4">
|
|
26
|
-
<KolHeading _level={2} _label="Button Variants" />
|
|
25
|
+
<SampleBlock id="variants" heading="Button Variants" fitContent>
|
|
27
26
|
<div className="flex flex-wrap gap-4">
|
|
28
27
|
<KolButton _icons="kolicon-house" _label="Primary" _variant="primary" onClick={dummyClickEventHandler} />
|
|
29
28
|
<KolButton _icons="kolicon-kolibri" _label="Secondary" _variant="secondary" onClick={dummyClickEventHandler} />
|
|
@@ -32,31 +31,25 @@ export const ButtonBasic: FC = () => {
|
|
|
32
31
|
<KolButton _icons="kolicon-alert-warning" _label="Danger" _variant="danger" _on={dummyEventHandler} />
|
|
33
32
|
<KolButton _icons="kolicon-eye-closed" _label="Ghost" _variant="ghost" _on={dummyEventHandler} />
|
|
34
33
|
</div>
|
|
35
|
-
</
|
|
34
|
+
</SampleBlock>
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
<section className="grid gap-4">
|
|
39
|
-
<KolHeading _level={2} _label="Disabled State" />
|
|
36
|
+
<SampleBlock id="disabled" heading="Disabled State" fitContent>
|
|
40
37
|
<div className="flex flex-wrap gap-4">
|
|
41
38
|
<KolButton _disabled _icons="kolicon-house" _label="Primary" _variant="primary" _on={dummyEventHandler} />
|
|
42
39
|
<KolButton _disabled _icons="kolicon-kolibri" _label="Secondary" _variant="secondary" _on={dummyEventHandler} />
|
|
43
40
|
<KolButton _disabled _icons="kolicon-alert-warning" _label="Danger" _variant="danger" _on={dummyEventHandler} />
|
|
44
41
|
</div>
|
|
45
|
-
</
|
|
42
|
+
</SampleBlock>
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
<section className="grid gap-4">
|
|
49
|
-
<KolHeading _level={2} _label="Hidden Label (Icon Only)" />
|
|
44
|
+
<SampleBlock id="hide-label" heading="Hidden Label (Icon Only)" fitContent>
|
|
50
45
|
<div className="flex flex-wrap gap-4">
|
|
51
46
|
<KolButton _hideLabel _icons="kolicon-house" _label="Primary" _variant="primary" _on={dummyEventHandler} />
|
|
52
47
|
<KolButton _hideLabel _icons="kolicon-kolibri" _label="Secondary" _variant="secondary" _on={dummyEventHandler} />
|
|
53
48
|
<KolButton _hideLabel _icons="kolicon-alert-warning" _label="Danger" _variant="danger" _on={dummyEventHandler} />
|
|
54
49
|
</div>
|
|
55
|
-
</
|
|
50
|
+
</SampleBlock>
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
<section className="grid gap-4">
|
|
59
|
-
<KolHeading _level={2} _label="Icon Positions" />
|
|
52
|
+
<SampleBlock id="icon-positions" heading="Icon Positions" fitContent>
|
|
60
53
|
<div className="flex flex-wrap gap-4">
|
|
61
54
|
<KolButton
|
|
62
55
|
_icons={{
|
|
@@ -81,7 +74,7 @@ export const ButtonBasic: FC = () => {
|
|
|
81
74
|
_on={dummyEventHandler}
|
|
82
75
|
/>
|
|
83
76
|
</div>
|
|
84
|
-
</
|
|
77
|
+
</SampleBlock>
|
|
85
78
|
</div>
|
|
86
79
|
</>
|
|
87
80
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonDisabled: FC = () => {
|
|
@@ -18,8 +19,7 @@ export const ButtonDisabled: FC = () => {
|
|
|
18
19
|
</SampleDescription>
|
|
19
20
|
|
|
20
21
|
<div className="grid gap-8">
|
|
21
|
-
<
|
|
22
|
-
<KolHeading _level={2} _label="Disabled Buttons" />
|
|
22
|
+
<SampleBlock id="disabled" heading="Disabled Buttons" fitContent>
|
|
23
23
|
<div className="flex flex-wrap gap-4">
|
|
24
24
|
<KolButton _disabled _icons="kolicon-house" _label="Primary" _variant="primary" _on={dummyEventHandler} />
|
|
25
25
|
<KolButton _disabled _icons="kolicon-kolibri" _label="Secondary" _variant="secondary" _on={dummyEventHandler} />
|
|
@@ -28,15 +28,14 @@ export const ButtonDisabled: FC = () => {
|
|
|
28
28
|
<KolButton _disabled _icons="kolicon-alert-warning" _label="Danger" _variant="danger" _on={dummyEventHandler} />
|
|
29
29
|
<KolButton _disabled _icons="kolicon-eye-closed" _label="Ghost" _variant="ghost" _on={dummyEventHandler} />
|
|
30
30
|
</div>
|
|
31
|
-
</
|
|
31
|
+
</SampleBlock>
|
|
32
32
|
|
|
33
|
-
<
|
|
34
|
-
<KolHeading _level={2} _label="Comparison: Enabled vs Disabled" />
|
|
33
|
+
<SampleBlock id="comparison" heading="Comparison: Enabled vs Disabled" fitContent>
|
|
35
34
|
<div className="flex flex-wrap gap-4">
|
|
36
35
|
<KolButton _icons="kolicon-house" _label="Enabled" _variant="primary" _on={dummyEventHandler} />
|
|
37
36
|
<KolButton _disabled _icons="kolicon-house" _label="Disabled" _variant="primary" _on={dummyEventHandler} />
|
|
38
37
|
</div>
|
|
39
|
-
</
|
|
38
|
+
</SampleBlock>
|
|
40
39
|
</div>
|
|
41
40
|
</>
|
|
42
41
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton,
|
|
1
|
+
import { KolButton, KolIcon } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
import './expert-slot.tooltip.scss';
|
|
@@ -25,8 +26,7 @@ export const ButtonExpertSlot: FC = () => {
|
|
|
25
26
|
</SampleDescription>
|
|
26
27
|
|
|
27
28
|
<div className="grid gap-8">
|
|
28
|
-
<
|
|
29
|
-
<KolHeading _level={2} _label="Buttons with Expert Slot Content" />
|
|
29
|
+
<SampleBlock id="buttons-expert-slot-content" heading="Buttons with Expert Slot Content" fitContent>
|
|
30
30
|
<div className="flex flex-wrap gap-4">
|
|
31
31
|
<KolButton _icons="kolicon-house" _label="" _variant="primary" _on={dummyEventHandler}>
|
|
32
32
|
<span slot="expert">I am more than just a button</span>
|
|
@@ -42,10 +42,9 @@ export const ButtonExpertSlot: FC = () => {
|
|
|
42
42
|
</KolButton>
|
|
43
43
|
<KolTooltip _label="Delete with custom text" />
|
|
44
44
|
</div>
|
|
45
|
-
</
|
|
45
|
+
</SampleBlock>
|
|
46
46
|
|
|
47
|
-
<
|
|
48
|
-
<KolHeading _level={2} _label="Disabled Buttons with Expert Slot" />
|
|
47
|
+
<SampleBlock id="disabled-buttons-expert-slot" heading="Disabled Buttons with Expert Slot" fitContent>
|
|
49
48
|
<div className="flex flex-wrap gap-4">
|
|
50
49
|
<KolButton _disabled _icons="kolicon-house" _label="" _variant="primary" _on={dummyEventHandler}>
|
|
51
50
|
<span slot="expert">Disabled expert slot</span>
|
|
@@ -54,7 +53,7 @@ export const ButtonExpertSlot: FC = () => {
|
|
|
54
53
|
<span slot="expert">Another disabled one</span>
|
|
55
54
|
</KolButton>
|
|
56
55
|
</div>
|
|
57
|
-
</
|
|
56
|
+
</SampleBlock>
|
|
58
57
|
</div>
|
|
59
58
|
</>
|
|
60
59
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { KolFocusOptions, SelectOption } from '@public-ui/components';
|
|
2
|
-
import { KolButton,
|
|
2
|
+
import { KolButton, KolSelect } from '@public-ui/react-v19';
|
|
3
3
|
import type { FC } from 'react';
|
|
4
4
|
import React, { useCallback, useRef, useState } from 'react';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
const BEHAVIOR_OPTIONS: SelectOption<string>[] = [
|
|
@@ -83,8 +84,7 @@ export const ButtonFocusOptions: FC = () => {
|
|
|
83
84
|
|
|
84
85
|
<div className="grid gap-8">
|
|
85
86
|
{/* Scroll Into View Options */}
|
|
86
|
-
<
|
|
87
|
-
<KolHeading _level={2} _label="Scroll Behavior Options" />
|
|
87
|
+
<SampleBlock id="scroll-behavior-options" heading="Scroll Behavior Options">
|
|
88
88
|
<p>
|
|
89
89
|
These options control how elements are scrolled into view. <code>preventScroll</code> and <code>focusVisible</code> are always enabled for optimal
|
|
90
90
|
focus management. Customize the scroll behavior and alignment below:
|
|
@@ -107,11 +107,10 @@ export const ButtonFocusOptions: FC = () => {
|
|
|
107
107
|
</div>
|
|
108
108
|
))}
|
|
109
109
|
</div>
|
|
110
|
-
</
|
|
110
|
+
</SampleBlock>
|
|
111
111
|
|
|
112
112
|
{/* Scroll Example */}
|
|
113
|
-
<
|
|
114
|
-
<KolHeading _level={2} _label="Scroll Example" />
|
|
113
|
+
<SampleBlock id="scroll-example" heading="Scroll Example">
|
|
115
114
|
<p>The target button is positioned bottom-right. Scroll down and right to find it, then click "Focus Target" to apply scroll behavior.</p>
|
|
116
115
|
|
|
117
116
|
<div className="flex gap-4">
|
|
@@ -147,13 +146,12 @@ export const ButtonFocusOptions: FC = () => {
|
|
|
147
146
|
/>
|
|
148
147
|
</div>
|
|
149
148
|
</div>
|
|
150
|
-
</
|
|
149
|
+
</SampleBlock>
|
|
151
150
|
|
|
152
151
|
<hr />
|
|
153
152
|
|
|
154
153
|
{/* Description */}
|
|
155
|
-
<
|
|
156
|
-
<KolHeading _level={2} _label="About KolFocusOptions" />
|
|
154
|
+
<SampleBlock id="about-kol-focus-options" heading="About KolFocusOptions">
|
|
157
155
|
<div className="indented-text">
|
|
158
156
|
<p>KolFocusOptions enables advanced focus control with scroll-into-view behavior:</p>
|
|
159
157
|
<ul className="list-disc pl-5">
|
|
@@ -177,7 +175,7 @@ export const ButtonFocusOptions: FC = () => {
|
|
|
177
175
|
</li>
|
|
178
176
|
</ul>
|
|
179
177
|
</div>
|
|
180
|
-
</
|
|
178
|
+
</SampleBlock>
|
|
181
179
|
</div>
|
|
182
180
|
</>
|
|
183
181
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonHideLabel: FC = () => {
|
|
@@ -21,8 +22,7 @@ export const ButtonHideLabel: FC = () => {
|
|
|
21
22
|
</SampleDescription>
|
|
22
23
|
|
|
23
24
|
<div className="grid gap-8">
|
|
24
|
-
<
|
|
25
|
-
<KolHeading _level={2} _label="Buttons with Hidden Labels" />
|
|
25
|
+
<SampleBlock id="hide-label" heading="Buttons with Hidden Labels" fitContent>
|
|
26
26
|
<div className="flex flex-wrap gap-4">
|
|
27
27
|
<KolButton _hideLabel _icons="kolicon-house" _label="Home" _variant="primary" _on={dummyEventHandler} />
|
|
28
28
|
<KolButton _hideLabel _icons="kolicon-kolibri" _label="Like" _variant="secondary" _on={dummyEventHandler} />
|
|
@@ -31,18 +31,16 @@ export const ButtonHideLabel: FC = () => {
|
|
|
31
31
|
<KolButton _hideLabel _icons="kolicon-alert-warning" _label="Delete" _variant="danger" _on={dummyEventHandler} />
|
|
32
32
|
<KolButton _hideLabel _icons="kolicon-eye-closed" _label="Settings" _variant="ghost" _on={dummyEventHandler} />
|
|
33
33
|
</div>
|
|
34
|
-
</
|
|
34
|
+
</SampleBlock>
|
|
35
35
|
|
|
36
|
-
<
|
|
37
|
-
<KolHeading _level={2} _label="Comparison: With and Without Hidden Label" />
|
|
36
|
+
<SampleBlock id="comparison" heading="Comparison: With and Without Hidden Label" fitContent>
|
|
38
37
|
<div className="flex flex-wrap gap-4">
|
|
39
38
|
<KolButton _icons="kolicon-house" _label="Home" _variant="primary" _on={dummyEventHandler} />
|
|
40
39
|
<KolButton _hideLabel _icons="kolicon-house" _label="Home" _variant="primary" _on={dummyEventHandler} />
|
|
41
40
|
</div>
|
|
42
|
-
</
|
|
41
|
+
</SampleBlock>
|
|
43
42
|
|
|
44
|
-
<
|
|
45
|
-
<KolHeading _level={2} _label="Disabled with Hidden Label" />
|
|
43
|
+
<SampleBlock id="disabled" heading="Disabled with Hidden Label" fitContent>
|
|
46
44
|
<div className="flex flex-wrap gap-4">
|
|
47
45
|
<KolButton _disabled _hideLabel _icons="kolicon-house" _label="Home" _variant="primary" _on={dummyEventHandler} />
|
|
48
46
|
<KolButton _disabled _hideLabel _icons="kolicon-kolibri" _label="Like" _variant="secondary" _on={dummyEventHandler} />
|
|
@@ -50,7 +48,7 @@ export const ButtonHideLabel: FC = () => {
|
|
|
50
48
|
<KolButton _disabled _hideLabel _icons="kolicon-cogwheel" _label="Buy me a coffee" _variant="normal" _on={dummyEventHandler} />
|
|
51
49
|
<KolButton _disabled _hideLabel _icons="kolicon-alert-warning" _label="Delete" _variant="danger" _on={dummyEventHandler} />
|
|
52
50
|
</div>
|
|
53
|
-
</
|
|
51
|
+
</SampleBlock>
|
|
54
52
|
</div>
|
|
55
53
|
</>
|
|
56
54
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonIcons: FC = () => {
|
|
@@ -20,8 +21,7 @@ export const ButtonIcons: FC = () => {
|
|
|
20
21
|
</SampleDescription>
|
|
21
22
|
|
|
22
23
|
<div className="grid gap-8">
|
|
23
|
-
<
|
|
24
|
-
<KolHeading _level={2} _label="Basic Icon Positions" />
|
|
24
|
+
<SampleBlock id="basic-positions" heading="Basic Icon Positions" fitContent>
|
|
25
25
|
<div className="flex flex-wrap gap-4">
|
|
26
26
|
<KolButton
|
|
27
27
|
_icons={{
|
|
@@ -52,10 +52,9 @@ export const ButtonIcons: FC = () => {
|
|
|
52
52
|
_on={dummyEventHandler}
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
55
|
-
</
|
|
55
|
+
</SampleBlock>
|
|
56
56
|
|
|
57
|
-
<
|
|
58
|
-
<KolHeading _level={2} _label="Multiple Icon Positions" />
|
|
57
|
+
<SampleBlock id="multiple-positions" heading="Multiple Icon Positions" fitContent>
|
|
59
58
|
<div className="flex flex-wrap gap-4">
|
|
60
59
|
<KolButton
|
|
61
60
|
_icons={{
|
|
@@ -74,10 +73,9 @@ export const ButtonIcons: FC = () => {
|
|
|
74
73
|
_on={dummyEventHandler}
|
|
75
74
|
/>
|
|
76
75
|
</div>
|
|
77
|
-
</
|
|
76
|
+
</SampleBlock>
|
|
78
77
|
|
|
79
|
-
<
|
|
80
|
-
<KolHeading _level={2} _label="All Icon Positions" />
|
|
78
|
+
<SampleBlock id="all-positions" heading="All Icon Positions" fitContent>
|
|
81
79
|
<div className="flex flex-wrap gap-4">
|
|
82
80
|
<KolButton
|
|
83
81
|
_icons={{
|
|
@@ -90,19 +88,17 @@ export const ButtonIcons: FC = () => {
|
|
|
90
88
|
_on={dummyEventHandler}
|
|
91
89
|
/>
|
|
92
90
|
</div>
|
|
93
|
-
</
|
|
91
|
+
</SampleBlock>
|
|
94
92
|
|
|
95
|
-
<
|
|
96
|
-
<KolHeading _level={2} _label="Simple Icon String" />
|
|
93
|
+
<SampleBlock id="icon-string" heading="Simple Icon String" fitContent>
|
|
97
94
|
<div className="flex flex-wrap gap-4">
|
|
98
95
|
<KolButton _icons="kolicon-house" _label="Home Icon" _on={dummyEventHandler} />
|
|
99
96
|
<KolButton _icons="kolicon-kolibri" _label="Heart Icon" _on={dummyEventHandler} />
|
|
100
97
|
<KolButton _icons="kolicon-alert-warning" _label="Trash Icon" _on={dummyEventHandler} />
|
|
101
98
|
</div>
|
|
102
|
-
</
|
|
99
|
+
</SampleBlock>
|
|
103
100
|
|
|
104
|
-
<
|
|
105
|
-
<KolHeading _level={2} _label="Large Icon on Top" />
|
|
101
|
+
<SampleBlock id="large-icon" heading="Large Icon on Top" fitContent>
|
|
106
102
|
<div className="flex flex-wrap gap-4">
|
|
107
103
|
<KolButton
|
|
108
104
|
_icons={{
|
|
@@ -117,7 +113,7 @@ export const ButtonIcons: FC = () => {
|
|
|
117
113
|
_on={dummyEventHandler}
|
|
118
114
|
/>
|
|
119
115
|
</div>
|
|
120
|
-
</
|
|
116
|
+
</SampleBlock>
|
|
121
117
|
</div>
|
|
122
118
|
</>
|
|
123
119
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const ButtonRowReverseTooltip: FC = () => {
|
|
@@ -14,12 +15,11 @@ export const ButtonRowReverseTooltip: FC = () => {
|
|
|
14
15
|
</SampleDescription>
|
|
15
16
|
|
|
16
17
|
<div className="grid gap-8">
|
|
17
|
-
<
|
|
18
|
-
<KolHeading _level={2} _label="Button in Row-Reverse Container" />
|
|
18
|
+
<SampleBlock id="button-row-reverse-container" heading="Button in Row-Reverse Container">
|
|
19
19
|
<div className="flex flex-row-reverse">
|
|
20
20
|
<KolButton _icons="kolicon-house" _hideLabel _label="This is a very, very long tooltip text that exceeds the width." _variant="primary" />
|
|
21
21
|
</div>
|
|
22
|
-
</
|
|
22
|
+
</SampleBlock>
|
|
23
23
|
</div>
|
|
24
24
|
</>
|
|
25
25
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolAlert, KolButton,
|
|
1
|
+
import { KolAlert, KolButton, KolLink } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonShortKey: FC = () => {
|
|
@@ -57,24 +58,21 @@ export const ButtonShortKey: FC = () => {
|
|
|
57
58
|
</KolAlert>
|
|
58
59
|
|
|
59
60
|
<div className="grid gap-8">
|
|
60
|
-
<
|
|
61
|
-
<KolHeading _level={2} _label="Buttons with Short Keys" />
|
|
61
|
+
<SampleBlock id="short-keys" heading="Buttons with Short Keys" fitContent>
|
|
62
62
|
<div className="flex flex-wrap gap-4">
|
|
63
63
|
<KolButton _label="With S short key" _shortKey="S" _on={dummyEventHandler} />
|
|
64
64
|
<KolButton _label="Very small b" _shortKey="b" _on={dummyEventHandler} />
|
|
65
65
|
<KolButton _label="Short key does not appear in label" _shortKey="x" _on={dummyEventHandler} />
|
|
66
66
|
</div>
|
|
67
|
-
</
|
|
67
|
+
</SampleBlock>
|
|
68
68
|
|
|
69
|
-
<
|
|
70
|
-
<KolHeading _level={2} _label="Short Key with Hidden Label" />
|
|
69
|
+
<SampleBlock id="hide-label" heading="Short Key with Hidden Label" fitContent>
|
|
71
70
|
<div className="flex flex-wrap gap-4">
|
|
72
71
|
<KolButton _label="short key without label" _hideLabel _shortKey="k" _icons="kolicon-cogwheel" _on={dummyEventHandler} />
|
|
73
72
|
</div>
|
|
74
|
-
</
|
|
73
|
+
</SampleBlock>
|
|
75
74
|
|
|
76
|
-
<
|
|
77
|
-
<KolHeading _level={2} _label="Short Key with Inline Icons" />
|
|
75
|
+
<SampleBlock id="inline-icons" heading="Short Key with Inline Icons" fitContent>
|
|
78
76
|
<div className="flex flex-wrap gap-4">
|
|
79
77
|
<KolButton
|
|
80
78
|
_label="with inline icons"
|
|
@@ -86,18 +84,15 @@ export const ButtonShortKey: FC = () => {
|
|
|
86
84
|
_on={dummyEventHandler}
|
|
87
85
|
/>
|
|
88
86
|
</div>
|
|
89
|
-
</
|
|
87
|
+
</SampleBlock>
|
|
90
88
|
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<KolButton _label="With working M short key" _shortKey={interactiveShortKey} _on={dummyEventHandler} />
|
|
99
|
-
</div>
|
|
100
|
-
</section>
|
|
89
|
+
<p>
|
|
90
|
+
This button wires the announced short key up manually: a <code>keydown</code> listener triggers the same action as a click. Press <kbd>Alt</kbd> +{' '}
|
|
91
|
+
<kbd>M</kbd> (or click the button) to open the toast.
|
|
92
|
+
</p>
|
|
93
|
+
<div className="flex flex-wrap gap-4">
|
|
94
|
+
<KolButton _label="With working M short key" _shortKey={interactiveShortKey} _on={dummyEventHandler} />
|
|
95
|
+
</div>
|
|
101
96
|
</div>
|
|
102
97
|
</>
|
|
103
98
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonSpinner: FC = () => {
|
|
@@ -21,8 +22,7 @@ export const ButtonSpinner: FC = () => {
|
|
|
21
22
|
</SampleDescription>
|
|
22
23
|
|
|
23
24
|
<div className="grid gap-8">
|
|
24
|
-
<
|
|
25
|
-
<KolHeading _level={2} _label="Animated Spinner Icon via CSS Part" />
|
|
25
|
+
<SampleBlock id="animated-spinner-icon-css-part" heading="Animated Spinner Icon via CSS Part" fitContent>
|
|
26
26
|
<div className="flex flex-wrap gap-4">
|
|
27
27
|
<KolButton
|
|
28
28
|
className="spinner-button"
|
|
@@ -55,10 +55,9 @@ export const ButtonSpinner: FC = () => {
|
|
|
55
55
|
_on={dummyEventHandler}
|
|
56
56
|
/>
|
|
57
57
|
</div>
|
|
58
|
-
</
|
|
58
|
+
</SampleBlock>
|
|
59
59
|
|
|
60
|
-
<
|
|
61
|
-
<KolHeading _level={2} _label="Spinner with Label" />
|
|
60
|
+
<SampleBlock id="spinner-label" heading="Spinner with Label" fitContent>
|
|
62
61
|
<div className="flex flex-wrap gap-4">
|
|
63
62
|
<KolButton
|
|
64
63
|
className="spinner-button"
|
|
@@ -79,7 +78,7 @@ export const ButtonSpinner: FC = () => {
|
|
|
79
78
|
_on={dummyEventHandler}
|
|
80
79
|
/>
|
|
81
80
|
</div>
|
|
82
|
-
</
|
|
81
|
+
</SampleBlock>
|
|
83
82
|
</div>
|
|
84
83
|
|
|
85
84
|
<style>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { useSearchParams } from 'react-router';
|
|
5
5
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
6
6
|
import { fetchVariantData } from '../../shares/fetchVariantData';
|
|
7
|
-
import {
|
|
7
|
+
import { getTheme } from '../../shares/store';
|
|
8
|
+
import { SampleBlock } from '../SampleBlock';
|
|
8
9
|
import { SampleDescription } from '../SampleDescription';
|
|
9
10
|
|
|
10
11
|
export const ButtonVariants: FC = () => {
|
|
11
12
|
const [searchParams] = useSearchParams();
|
|
12
|
-
const theme = searchParams.get('theme') ??
|
|
13
|
+
const theme = searchParams.get('theme') ?? getTheme();
|
|
13
14
|
const data = useMemo(() => (theme ? fetchVariantData(theme, 'buttonVariants') : []), [theme]);
|
|
14
15
|
|
|
15
16
|
const { dummyClickEventHandler } = useToasterService();
|
|
@@ -28,8 +29,7 @@ export const ButtonVariants: FC = () => {
|
|
|
28
29
|
</SampleDescription>
|
|
29
30
|
|
|
30
31
|
<div className="grid gap-8">
|
|
31
|
-
<
|
|
32
|
-
<KolHeading _level={2} _label="All theme exclusive button variants" />
|
|
32
|
+
<SampleBlock id="variants" heading="All theme exclusive button variants" fitContent>
|
|
33
33
|
<div className="flex flex-wrap gap-4 items-center">
|
|
34
34
|
{!Array.isArray(data) || data.length === 0 ? (
|
|
35
35
|
<p>This theme has no variants for this component.</p>
|
|
@@ -48,7 +48,7 @@ export const ButtonVariants: FC = () => {
|
|
|
48
48
|
})
|
|
49
49
|
)}
|
|
50
50
|
</div>
|
|
51
|
-
</
|
|
51
|
+
</SampleBlock>
|
|
52
52
|
</div>
|
|
53
53
|
</>
|
|
54
54
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { KolButton
|
|
1
|
+
import { KolButton } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const ButtonWidth: FC = () => {
|
|
@@ -21,8 +22,7 @@ export const ButtonWidth: FC = () => {
|
|
|
21
22
|
</SampleDescription>
|
|
22
23
|
|
|
23
24
|
<div className="grid gap-8">
|
|
24
|
-
<
|
|
25
|
-
<KolHeading _level={2} _label="Fixed Width Buttons (8rem)" />
|
|
25
|
+
<SampleBlock id="fixed-width-buttons-8rem" heading="Fixed Width Buttons (8rem)" fitContent>
|
|
26
26
|
<div className="flex flex-wrap gap-4">
|
|
27
27
|
<KolButton _label="Primary" _variant="primary" {...ARGS} />
|
|
28
28
|
<KolButton _label="Secondary" _variant="secondary" {...ARGS} />
|
|
@@ -30,10 +30,9 @@ export const ButtonWidth: FC = () => {
|
|
|
30
30
|
<KolButton _label="Danger" _variant="danger" {...ARGS} />
|
|
31
31
|
<KolButton _label="Ghost" _variant="ghost" {...ARGS} />
|
|
32
32
|
</div>
|
|
33
|
-
</
|
|
33
|
+
</SampleBlock>
|
|
34
34
|
|
|
35
|
-
<
|
|
36
|
-
<KolHeading _level={2} _label="Fixed Width Disabled Buttons (8rem)" />
|
|
35
|
+
<SampleBlock id="fixed-width-disabled-buttons" heading="Fixed Width Disabled Buttons (8rem)" fitContent>
|
|
37
36
|
<div className="flex flex-wrap gap-4">
|
|
38
37
|
<KolButton _disabled _label="Primary" _variant="primary" {...ARGS} />
|
|
39
38
|
<KolButton _disabled _label="Secondary" _variant="secondary" {...ARGS} />
|
|
@@ -41,7 +40,7 @@ export const ButtonWidth: FC = () => {
|
|
|
41
40
|
<KolButton _disabled _label="Danger" _variant="danger" {...ARGS} />
|
|
42
41
|
<KolButton _disabled _label="Ghost" _variant="ghost" {...ARGS} />
|
|
43
42
|
</div>
|
|
44
|
-
</
|
|
43
|
+
</SampleBlock>
|
|
45
44
|
</div>
|
|
46
45
|
</>
|
|
47
46
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KolButtonLink } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const ButtonLinkAriaDescription: FC = () => (
|
|
@@ -9,9 +10,9 @@ export const ButtonLinkAriaDescription: FC = () => (
|
|
|
9
10
|
<p>This sample shows KolButtonLink with aria-description</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="aria-description" className="flex flex-wrap gap-4">
|
|
13
14
|
<KolButtonLink _label="Button Text without area description"></KolButtonLink>
|
|
14
15
|
<KolButtonLink _label="Button Text" _ariaDescription="Button Area Description"></KolButtonLink>
|
|
15
|
-
</
|
|
16
|
+
</SampleBlock>
|
|
16
17
|
</>
|
|
17
18
|
);
|