@progressive-development/pd-forms 0.9.1 → 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.
- package/LICENSE +21 -2
- package/README.md +56 -62
- package/dist/base/pd-base-input-element.d.ts +10 -10
- package/dist/base/pd-base-input-element.d.ts.map +1 -1
- package/dist/base/pd-base-input-element.js +8 -1
- package/dist/base/pd-base-ui-input.d.ts +41 -16
- package/dist/base/pd-base-ui-input.d.ts.map +1 -1
- package/dist/base/pd-base-ui-input.js +25 -6
- package/dist/base/pd-base-ui.d.ts.map +1 -1
- package/dist/base/pd-base-ui.js +1 -20
- package/dist/generated/locales/be.d.ts +3 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +3 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +3 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/locales/be.js +4 -1
- package/dist/locales/de.js +4 -1
- package/dist/locales/en.js +4 -1
- package/dist/pd-button/PdButton.d.ts +171 -37
- package/dist/pd-button/PdButton.d.ts.map +1 -1
- package/dist/pd-button/PdButton.js +502 -71
- package/dist/pd-button/pd-button.stories.d.ts +82 -10
- package/dist/pd-button/pd-button.stories.d.ts.map +1 -1
- package/dist/pd-button-group/PdButtonGroup.d.ts +25 -0
- package/dist/pd-button-group/PdButtonGroup.d.ts.map +1 -1
- package/dist/pd-button-group/PdButtonGroup.js +52 -27
- package/dist/pd-button-group/pd-button-group.stories.d.ts +42 -17
- package/dist/pd-button-group/pd-button-group.stories.d.ts.map +1 -1
- package/dist/pd-button-select-group/PdButtonSelectGroup.d.ts +17 -3
- package/dist/pd-button-select-group/PdButtonSelectGroup.d.ts.map +1 -1
- package/dist/pd-button-select-group/PdButtonSelectGroup.js +23 -19
- package/dist/pd-button-select-group/pd-button-select-group.stories.d.ts +43 -18
- package/dist/pd-button-select-group/pd-button-select-group.stories.d.ts.map +1 -1
- package/dist/pd-checkbox/PdCheckbox.d.ts +23 -2
- package/dist/pd-checkbox/PdCheckbox.d.ts.map +1 -1
- package/dist/pd-checkbox/PdCheckbox.js +85 -21
- package/dist/pd-checkbox/pd-checkbox.stories.d.ts +43 -27
- package/dist/pd-checkbox/pd-checkbox.stories.d.ts.map +1 -1
- package/dist/pd-form-container/PdFormContainer.d.ts +30 -9
- package/dist/pd-form-container/PdFormContainer.d.ts.map +1 -1
- package/dist/pd-form-container/PdFormContainer.js +59 -8
- package/dist/pd-form-container/pd-form-container.stories.d.ts +49 -0
- package/dist/pd-form-container/pd-form-container.stories.d.ts.map +1 -0
- package/dist/pd-form-field/PdFormField.d.ts +35 -0
- package/dist/pd-form-field/PdFormField.d.ts.map +1 -0
- package/dist/pd-form-field/PdFormField.js +38 -0
- package/dist/pd-form-field/pd-form-field.d.ts +3 -0
- package/dist/pd-form-field/pd-form-field.d.ts.map +1 -0
- package/dist/pd-form-field/pd-form-field.stories.d.ts +40 -0
- package/dist/pd-form-field/pd-form-field.stories.d.ts.map +1 -0
- package/dist/pd-form-field.d.ts +2 -0
- package/dist/pd-form-field.js +8 -0
- package/dist/pd-form-fieldset/PdFormFieldset.d.ts +144 -0
- package/dist/pd-form-fieldset/PdFormFieldset.d.ts.map +1 -0
- package/dist/pd-form-fieldset/PdFormFieldset.js +364 -0
- package/dist/pd-form-fieldset/index.d.ts +2 -0
- package/dist/pd-form-fieldset/index.d.ts.map +1 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.d.ts +3 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.d.ts.map +1 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.js +8 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.stories.d.ts +38 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.stories.d.ts.map +1 -0
- package/dist/pd-form-row/PdFormRow.d.ts +35 -5
- package/dist/pd-form-row/PdFormRow.d.ts.map +1 -1
- package/dist/pd-form-row/PdFormRow.js +135 -69
- package/dist/pd-form-row/pd-form-row.stories.d.ts +41 -25
- package/dist/pd-form-row/pd-form-row.stories.d.ts.map +1 -1
- package/dist/pd-generic-form/PdGenericForm.d.ts +50 -0
- package/dist/pd-generic-form/PdGenericForm.d.ts.map +1 -0
- package/dist/pd-generic-form/PdGenericForm.js +334 -0
- package/dist/pd-generic-form/pd-generic-form.d.ts +3 -0
- package/dist/pd-generic-form/pd-generic-form.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.stories.d.ts +35 -0
- package/dist/pd-generic-form/pd-generic-form.stories.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.styles.d.ts +2 -0
- package/dist/pd-generic-form/pd-generic-form.styles.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.styles.js +110 -0
- package/dist/pd-generic-form/pd-generic-form.test.d.ts +1 -0
- package/dist/pd-generic-form/pd-generic-form.test.d.ts.map +1 -0
- package/dist/pd-generic-form.d.ts +2 -0
- package/dist/pd-generic-form.js +8 -0
- package/dist/pd-hover-box/PdHoverBox.d.ts +61 -11
- package/dist/pd-hover-box/PdHoverBox.d.ts.map +1 -1
- package/dist/pd-hover-box/PdHoverBox.js +130 -28
- package/dist/pd-hover-box/pd-hover-box.stories.d.ts +28 -5
- package/dist/pd-hover-box/pd-hover-box.stories.d.ts.map +1 -1
- package/dist/pd-input/PdComboboxInput.d.ts +20 -0
- package/dist/pd-input/PdComboboxInput.d.ts.map +1 -0
- package/dist/pd-input/PdComboboxInput.js +67 -0
- package/dist/pd-input/PdInput.d.ts +33 -15
- package/dist/pd-input/PdInput.d.ts.map +1 -1
- package/dist/pd-input/PdInput.js +49 -21
- package/dist/pd-input/pd-input.stories.d.ts +71 -35
- package/dist/pd-input/pd-input.stories.d.ts.map +1 -1
- package/dist/pd-input-area/PdInputArea.d.ts +19 -6
- package/dist/pd-input-area/PdInputArea.d.ts.map +1 -1
- package/dist/pd-input-area/PdInputArea.js +17 -15
- package/dist/pd-input-area/pd-input-area.stories.d.ts +65 -52
- package/dist/pd-input-area/pd-input-area.stories.d.ts.map +1 -1
- package/dist/pd-input-file/PdInputFile.d.ts +24 -0
- package/dist/pd-input-file/PdInputFile.d.ts.map +1 -1
- package/dist/pd-input-file/PdInputFile.js +53 -22
- package/dist/pd-input-file/pd-input-file.stories.d.ts +51 -47
- package/dist/pd-input-file/pd-input-file.stories.d.ts.map +1 -1
- package/dist/pd-input-time/PdInputTime.d.ts +21 -0
- package/dist/pd-input-time/PdInputTime.d.ts.map +1 -1
- package/dist/pd-input-time/PdInputTime.js +48 -22
- package/dist/pd-input-time/pd-input-time.stories.d.ts +94 -0
- package/dist/pd-input-time/pd-input-time.stories.d.ts.map +1 -0
- package/dist/pd-panel-button/PdPanelButton.d.ts +50 -34
- package/dist/pd-panel-button/PdPanelButton.d.ts.map +1 -1
- package/dist/pd-panel-button/PdPanelButton.js +149 -265
- package/dist/pd-panel-button/pd-panel-button.stories.d.ts +55 -25
- package/dist/pd-panel-button/pd-panel-button.stories.d.ts.map +1 -1
- package/dist/pd-radio-group/PdRadioGroup.d.ts +14 -0
- package/dist/pd-radio-group/PdRadioGroup.d.ts.map +1 -1
- package/dist/pd-radio-group/PdRadioGroup.js +48 -11
- package/dist/pd-radio-group/pd-radio-group.stories.d.ts +37 -7
- package/dist/pd-radio-group/pd-radio-group.stories.d.ts.map +1 -1
- package/dist/pd-range/PdRange.d.ts +22 -2
- package/dist/pd-range/PdRange.d.ts.map +1 -1
- package/dist/pd-range/PdRange.js +54 -43
- package/dist/pd-range/pd-range.stories.d.ts +49 -7
- package/dist/pd-range/pd-range.stories.d.ts.map +1 -1
- package/dist/pd-select/PdSelect.d.ts +16 -4
- package/dist/pd-select/PdSelect.d.ts.map +1 -1
- package/dist/pd-select/PdSelect.js +23 -21
- package/dist/pd-select/pd-select.stories.d.ts +56 -35
- package/dist/pd-select/pd-select.stories.d.ts.map +1 -1
- package/dist/pd-suggestion-box/PdSuggestionBox.d.ts +74 -0
- package/dist/pd-suggestion-box/PdSuggestionBox.d.ts.map +1 -0
- package/dist/pd-suggestion-box/PdSuggestionBox.js +277 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.d.ts +42 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.d.ts.map +1 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.js +227 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.d.ts +3 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.d.ts.map +1 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.stories.d.ts +79 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.stories.d.ts.map +1 -0
- package/dist/pd-suggestion-box.d.ts +2 -0
- package/dist/pd-suggestion-box.js +8 -0
- package/dist/pd-utils/dist/position-helper.js +35 -0
- package/dist/stories/pd-forms-overview.stories.d.ts +48 -0
- package/dist/stories/pd-forms-overview.stories.d.ts.map +1 -0
- package/dist/stories/story-helpers.d.ts +10 -0
- package/dist/stories/story-helpers.d.ts.map +1 -0
- package/dist/styles/shared-input-field-styles.d.ts.map +1 -1
- package/dist/styles/shared-input-field-styles.js +13 -19
- package/dist/styles/shared-input-styles.d.ts.map +1 -1
- package/dist/styles/shared-input-styles.js +18 -14
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -5
- package/dist/pd-form-container/form-container.stories.d.ts +0 -28
- package/dist/pd-form-container/form-container.stories.d.ts.map +0 -1
- package/dist/pd-form-container/form-container2.stories.d.ts +0 -8
- package/dist/pd-form-container/form-container2.stories.d.ts.map +0 -1
- package/dist/pd-form-container/form-container3.stories.d.ts +0 -11
- package/dist/pd-form-container/form-container3.stories.d.ts.map +0 -1
- package/dist/stories/01_index.stories.d.ts +0 -58
- package/dist/stories/01_index.stories.d.ts.map +0 -1
|
@@ -1,12 +1,84 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdButtonSize, PdButtonType } from './PdButton.js';
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-button component.
|
|
5
|
+
* Maps to the component's public API.
|
|
6
|
+
*/
|
|
7
|
+
interface PdButtonArgs {
|
|
8
|
+
/** The visible button label text */
|
|
9
|
+
text: string;
|
|
10
|
+
/** Icon name from pd-icon library */
|
|
11
|
+
icon: string;
|
|
12
|
+
/** Position of the icon: "start" or "end" */
|
|
13
|
+
iconPosition: "start" | "end";
|
|
14
|
+
/** Primary button styling */
|
|
15
|
+
primary: boolean;
|
|
16
|
+
/** Gradient background styling */
|
|
17
|
+
gradient: boolean;
|
|
18
|
+
/** Selected/toggle state */
|
|
19
|
+
selected: boolean;
|
|
20
|
+
/** Disabled state */
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
/** Loading state with spinner */
|
|
23
|
+
loading: boolean;
|
|
24
|
+
/** Full width mode */
|
|
25
|
+
fullWidth: boolean;
|
|
26
|
+
/** Custom value for button-clicked event */
|
|
27
|
+
value: string;
|
|
28
|
+
/** Size preset: sm, md, lg, xl */
|
|
29
|
+
size: PdButtonSize;
|
|
30
|
+
/** Native button type */
|
|
31
|
+
type: PdButtonType;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* ## pd-button
|
|
35
|
+
*
|
|
36
|
+
* A simple, accessible button component for form actions and general UI interactions.
|
|
37
|
+
*
|
|
38
|
+
* ### Features
|
|
39
|
+
* - Primary and secondary styles
|
|
40
|
+
* - Gradient background option
|
|
41
|
+
* - Selected/toggle state with `aria-pressed`
|
|
42
|
+
* - Icon support via `icon` property (pd-icon integration)
|
|
43
|
+
* - Icon-only buttons with proper accessibility
|
|
44
|
+
* - Loading state with spinner
|
|
45
|
+
* - Responsive scale system (sm, md, lg, xl)
|
|
46
|
+
* - Full keyboard accessibility (Enter, Space)
|
|
47
|
+
* - Native `<button>` element for proper semantics
|
|
48
|
+
* - CSS parts for external styling
|
|
49
|
+
* - Prefix and suffix slots for custom content
|
|
50
|
+
*
|
|
51
|
+
* ### Accessibility
|
|
52
|
+
* - Uses native `<button>` element
|
|
53
|
+
* - Keyboard navigation: Tab to focus, Enter/Space to activate
|
|
54
|
+
* - `aria-disabled` for disabled state
|
|
55
|
+
* - `aria-busy` for loading state
|
|
56
|
+
* - `aria-pressed` for selected/toggle state
|
|
57
|
+
* - `aria-label` for icon-only buttons
|
|
58
|
+
* - Focus-visible styling for keyboard users
|
|
59
|
+
* - Minimum touch target of 44x44px
|
|
60
|
+
*/
|
|
61
|
+
declare const meta: Meta<PdButtonArgs>;
|
|
7
62
|
export default meta;
|
|
8
|
-
type Story = StoryObj
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
63
|
+
type Story = StoryObj<PdButtonArgs>;
|
|
64
|
+
/** Default button with standard styling. Interactive via Controls panel. */
|
|
65
|
+
export declare const Default: Story;
|
|
66
|
+
/** All button variants and states at a glance. */
|
|
67
|
+
export declare const AllVariants: Story;
|
|
68
|
+
/** All size variants displayed together. */
|
|
69
|
+
export declare const AllSizes: Story;
|
|
70
|
+
/** Icon positions and icon-only buttons in one compact overview. */
|
|
71
|
+
export declare const Icons: Story;
|
|
72
|
+
/** Full width button that fills its container. */
|
|
73
|
+
export declare const FullWidth: Story;
|
|
74
|
+
/** Form action buttons — typical submit/cancel pattern. */
|
|
75
|
+
export declare const FormActions: Story;
|
|
76
|
+
/** Buttons using prefix/suffix slots for custom content. */
|
|
77
|
+
export declare const WithSlots: Story;
|
|
78
|
+
/** Interactive toggle button demo. */
|
|
79
|
+
export declare const ToggleButton: Story;
|
|
80
|
+
/** Demonstrates text wrapping behavior with long labels. */
|
|
81
|
+
export declare const TextLengths: Story;
|
|
82
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
83
|
+
export declare const CustomStyling: Story;
|
|
12
84
|
//# sourceMappingURL=pd-button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-button.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button/pd-button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pd-button.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button/pd-button.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAKrE,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAMhE;;;GAGG;AACH,UAAU,YAAY;IACpB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC;IAC9B,6BAA6B;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,yBAAyB;IACzB,IAAI,EAAE,YAAY,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAyG5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAMpC,4EAA4E;AAC5E,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,kDAAkD;AAClD,eAAO,MAAM,WAAW,EAAE,KAyDzB,CAAC;AAMF,4CAA4C;AAC5C,eAAO,MAAM,QAAQ,EAAE,KA6CtB,CAAC;AAMF,oEAAoE;AACpE,eAAO,MAAM,KAAK,EAAE,KAgFnB,CAAC;AAMF,kDAAkD;AAClD,eAAO,MAAM,SAAS,EAAE,KAqBvB,CAAC;AAMF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAE,KAezB,CAAC;AAMF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAC;AAMF,sCAAsC;AACtC,eAAO,MAAM,YAAY,EAAE,KA4C1B,CAAC;AAMF,4DAA4D;AAC5D,eAAO,MAAM,WAAW,EAAE,KA4DzB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KAyI3B,CAAC"}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
2
2
|
import { PdBaseUI } from '../base/pd-base-ui';
|
|
3
3
|
import { ButtonData } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Button group component for single-selection button sets.
|
|
6
|
+
*
|
|
7
|
+
* @tagname pd-button-group
|
|
8
|
+
* @summary Single-selection button group with horizontal or vertical layout.
|
|
9
|
+
*
|
|
10
|
+
* @event pd-button-group-change - Fired when selection changes. Emits `{selected}` detail.
|
|
11
|
+
*
|
|
12
|
+
* @cssprop --pd-button-group-direction - Flex direction. Default: `row`.
|
|
13
|
+
* @cssprop --pd-button-group-width - Group width. Default: `auto`.
|
|
14
|
+
* @cssprop --pd-radius-md - Border radius for outer corners. Default: `0.5rem`.
|
|
15
|
+
* @cssprop --pd-button-border-radius - Border radius for child buttons. Default: `0`.
|
|
16
|
+
* @cssprop --pd-button-width - Width for child buttons. Default: `100%`.
|
|
17
|
+
*/
|
|
4
18
|
export declare class PdButtonGroup extends PdBaseUI {
|
|
19
|
+
/** Array of button definitions (text, icon, disabled state). */
|
|
5
20
|
buttonList: ButtonData[];
|
|
21
|
+
/** Array of initially selected button indices. */
|
|
6
22
|
initValue: number[];
|
|
23
|
+
/** Stack buttons vertically instead of horizontally. */
|
|
24
|
+
vertical: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Accessible label for the button group.
|
|
27
|
+
* Required for screen readers to understand the purpose of the group.
|
|
28
|
+
* Example: "View options", "Time period", "Filter by category"
|
|
29
|
+
*/
|
|
30
|
+
groupLabel?: string;
|
|
31
|
+
/** @ignore */
|
|
7
32
|
private _selectedButtons;
|
|
8
33
|
static styles: CSSResultGroup;
|
|
9
34
|
willUpdate(changedProps: PropertyValues<this>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdButtonGroup.d.ts","sourceRoot":"","sources":["../../src/pd-button-group/PdButtonGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"PdButtonGroup.d.ts","sourceRoot":"","sources":["../../src/pd-button-group/PdButtonGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,cAAc,EAAW,MAAM,KAAK,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;GAaG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IACzC,gEAAgE;IAEhE,UAAU,EAAE,UAAU,EAAE,CAAM;IAE9B,kDAAkD;IAElD,SAAS,EAAE,MAAM,EAAE,CAAM;IAEzB,wDAAwD;IAExD,QAAQ,UAAS;IAEjB;;;;OAIG;IAEH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,cAAc;IAEd,OAAO,CAAC,gBAAgB,CAAgB;IAExC,OAAgB,MAAM,EAAE,cAAc,CAoDpC;IAEO,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAWtD,KAAK,CAAC,aAAa,EAAE,MAAM;IAIzB,MAAM;IA2Bf,OAAO,CAAC,OAAO;CAYhB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { css, html } from 'lit';
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
4
|
import { PdBaseUI } from '../base/pd-base-ui.js';
|
|
4
|
-
import '../pd-
|
|
5
|
+
import '../pd-button.js';
|
|
5
6
|
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -17,6 +18,7 @@ class PdButtonGroup extends PdBaseUI {
|
|
|
17
18
|
super(...arguments);
|
|
18
19
|
this.buttonList = [];
|
|
19
20
|
this.initValue = [];
|
|
21
|
+
this.vertical = false;
|
|
20
22
|
this._selectedButtons = [];
|
|
21
23
|
}
|
|
22
24
|
static {
|
|
@@ -27,40 +29,49 @@ class PdButtonGroup extends PdBaseUI {
|
|
|
27
29
|
display: inline-block;
|
|
28
30
|
--group-direction: var(--pd-button-group-direction, row);
|
|
29
31
|
--group-width: var(--pd-button-group-width, auto);
|
|
30
|
-
|
|
31
|
-
--group-border-radius: var(--pd-border-radius, 0.5rem);
|
|
32
|
+
--group-border-radius: var(--pd-radius-md);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.button-group {
|
|
35
36
|
display: flex;
|
|
36
37
|
flex-direction: var(--group-direction);
|
|
37
38
|
width: var(--group-width);
|
|
38
|
-
--pd-
|
|
39
|
+
--pd-button-width: 100%;
|
|
40
|
+
--pd-button-border-radius: 0;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
/*
|
|
42
|
-
.button-group pd-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
/* Horizontal layout (default): rounded left/right edges */
|
|
44
|
+
.button-group pd-button:first-child {
|
|
45
|
+
--pd-button-border-radius: var(--group-border-radius) 0 0
|
|
46
|
+
var(--group-border-radius);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
.button-group pd-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
.button-group pd-button:last-child {
|
|
50
|
+
--pd-button-border-radius: 0 var(--group-border-radius)
|
|
51
|
+
var(--group-border-radius) 0;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
border-top-right-radius: var(--group-border-radius);
|
|
55
|
-
border-bottom-left-radius: 0;
|
|
56
|
-
border-bottom-right-radius: 0;
|
|
54
|
+
.button-group pd-button:only-child {
|
|
55
|
+
--pd-button-border-radius: var(--group-border-radius);
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
/* Vertical layout: rounded top/bottom edges */
|
|
59
|
+
.button-group.vertical {
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.button-group.vertical pd-button:first-child {
|
|
64
|
+
--pd-button-border-radius: var(--group-border-radius)
|
|
65
|
+
var(--group-border-radius) 0 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.button-group.vertical pd-button:last-child {
|
|
69
|
+
--pd-button-border-radius: 0 0 var(--group-border-radius)
|
|
70
|
+
var(--group-border-radius);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.button-group.vertical pd-button:only-child {
|
|
74
|
+
--pd-button-border-radius: var(--group-border-radius);
|
|
64
75
|
}
|
|
65
76
|
`
|
|
66
77
|
];
|
|
@@ -74,17 +85,25 @@ class PdButtonGroup extends PdBaseUI {
|
|
|
74
85
|
this._selectedButtons = [selectedValue];
|
|
75
86
|
}
|
|
76
87
|
render() {
|
|
88
|
+
const groupClasses = {
|
|
89
|
+
"button-group": true,
|
|
90
|
+
vertical: this.vertical
|
|
91
|
+
};
|
|
77
92
|
return html`
|
|
78
|
-
<div
|
|
93
|
+
<div
|
|
94
|
+
class="${classMap(groupClasses)}"
|
|
95
|
+
role="group"
|
|
96
|
+
aria-label="${this.groupLabel || nothing}"
|
|
97
|
+
>
|
|
79
98
|
${this.buttonList.map(
|
|
80
99
|
(data, index) => html`
|
|
81
|
-
<pd-
|
|
100
|
+
<pd-button
|
|
82
101
|
?selected="${this._selectedButtons.includes(index)}"
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
text="${data.text || ""}"
|
|
103
|
+
icon="${data.pdIcon || ""}"
|
|
85
104
|
?disabled="${data.disabled === true}"
|
|
86
105
|
@button-clicked="${() => this.onClick(index)}"
|
|
87
|
-
></pd-
|
|
106
|
+
></pd-button>
|
|
88
107
|
`
|
|
89
108
|
)}
|
|
90
109
|
</div>
|
|
@@ -108,6 +127,12 @@ __decorateClass([
|
|
|
108
127
|
__decorateClass([
|
|
109
128
|
property({ type: Array })
|
|
110
129
|
], PdButtonGroup.prototype, "initValue");
|
|
130
|
+
__decorateClass([
|
|
131
|
+
property({ type: Boolean, reflect: true })
|
|
132
|
+
], PdButtonGroup.prototype, "vertical");
|
|
133
|
+
__decorateClass([
|
|
134
|
+
property({ type: String, attribute: "group-label" })
|
|
135
|
+
], PdButtonGroup.prototype, "groupLabel");
|
|
111
136
|
__decorateClass([
|
|
112
137
|
state()
|
|
113
138
|
], PdButtonGroup.prototype, "_selectedButtons");
|
|
@@ -1,20 +1,45 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { ButtonData } from '../types.js';
|
|
3
|
+
interface PdButtonGroupArgs {
|
|
4
|
+
buttonList: ButtonData[];
|
|
5
|
+
initValue: number[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* ## pd-button-group
|
|
9
|
+
*
|
|
10
|
+
* A button group component for single-selection button sets.
|
|
11
|
+
* Buttons are visually connected with shared borders and rounded outer corners.
|
|
12
|
+
*
|
|
13
|
+
* ### Features
|
|
14
|
+
* - Single-selection mode (radio-button-like behavior)
|
|
15
|
+
* - Horizontal or vertical layout via `vertical` attribute
|
|
16
|
+
* - Supports icons, text, or both via `ButtonData` array
|
|
17
|
+
* - Automatic border-radius handling for first/last/only buttons
|
|
18
|
+
* - Forwards `--pd-button-scale` to child buttons for consistent sizing
|
|
19
|
+
* - Custom colors via CSS custom properties
|
|
20
|
+
* - Emits `pd-button-group-change` event on selection change
|
|
21
|
+
*
|
|
22
|
+
* ### Accessibility
|
|
23
|
+
* - `role="group"` for screen reader grouping
|
|
24
|
+
* - `group-label` property for accessible group name (aria-label)
|
|
25
|
+
* - Individual buttons are keyboard navigable
|
|
26
|
+
* - Selected button has visual distinction (inset shadow)
|
|
27
|
+
* - Disabled buttons are skipped during selection
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
declare const meta: Meta<PdButtonGroupArgs>;
|
|
7
31
|
export default meta;
|
|
8
|
-
type Story = StoryObj
|
|
9
|
-
|
|
32
|
+
type Story = StoryObj<PdButtonGroupArgs>;
|
|
33
|
+
/** Default horizontal button group. Interactive via Controls panel. */
|
|
34
|
+
export declare const Default: Story;
|
|
35
|
+
/** Button group with pre-selected button via initValue. */
|
|
10
36
|
export declare const WithInitialSelection: Story;
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const WithDisabledButtons: Story;
|
|
37
|
+
/** Vertical button group layout. */
|
|
38
|
+
export declare const Vertical: Story;
|
|
39
|
+
/** Overview of all button group variants at a glance. */
|
|
40
|
+
export declare const AllVariants: Story;
|
|
41
|
+
/** Different sizing options using --pd-button-scale and --pd-button-group-width. */
|
|
42
|
+
export declare const Scaling: Story;
|
|
43
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
44
|
+
export declare const CustomStyling: Story;
|
|
20
45
|
//# sourceMappingURL=pd-button-group.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-button-group.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button-group/pd-button-group.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-button-group.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button-group/pd-button-group.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,sBAAsB,CAAC;AAM9B,UAAU,iBAAiB;IACzB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAmCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAwDjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAMzC,uEAAuE;AACvE,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAMF,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,EAAE,KASlC,CAAC;AAMF,oCAAoC;AACpC,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAMF,yDAAyD;AACzD,eAAO,MAAM,WAAW,EAAE,KAwDzB,CAAC;AAMF,oFAAoF;AACpF,eAAO,MAAM,OAAO,EAAE,KAsDrB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KA2G3B,CAAC"}
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
1
|
+
import { CSSResultGroup, PropertyValues, nothing } from 'lit';
|
|
2
2
|
import { PdBaseUI } from '../base/pd-base-ui.js';
|
|
3
3
|
import { ButtonData } from '../types.js';
|
|
4
4
|
/**
|
|
5
|
+
* Dropdown button selector combining pd-panel-button with pd-button-group.
|
|
6
|
+
*
|
|
5
7
|
* @tagname pd-button-select-group
|
|
8
|
+
*
|
|
9
|
+
* @event pd-button-selection-changed - Fired when selection changes with `{selected}` detail.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop --pd-panel-padding - Panel content padding. Default: `0px`.
|
|
6
12
|
*/
|
|
7
13
|
export declare class PdButtonSelectGroup extends PdBaseUI {
|
|
14
|
+
/** Array of selectable button options. */
|
|
8
15
|
options: ButtonData[];
|
|
16
|
+
/** Initially selected option index */
|
|
9
17
|
initValue: number;
|
|
18
|
+
/** Accessible label for the button group (announced by screen readers). */
|
|
19
|
+
groupLabel: string;
|
|
20
|
+
/** @ignore */
|
|
10
21
|
private _selectedValue;
|
|
11
|
-
|
|
22
|
+
/** @ignore */
|
|
23
|
+
private _buttonGroupEl?;
|
|
24
|
+
/** @ignore */
|
|
25
|
+
private _panelButtonEl?;
|
|
12
26
|
static styles: CSSResultGroup;
|
|
13
27
|
willUpdate(changedProps: PropertyValues<this>): void;
|
|
14
28
|
reset(selectedValue: number): void;
|
|
15
|
-
render(): import('lit').TemplateResult<1
|
|
29
|
+
render(): typeof nothing | import('lit').TemplateResult<1>;
|
|
16
30
|
private handleSelectionChange;
|
|
17
31
|
}
|
|
18
32
|
//# sourceMappingURL=PdButtonSelectGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdButtonSelectGroup.d.ts","sourceRoot":"","sources":["../../src/pd-button-select-group/PdButtonSelectGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"PdButtonSelectGroup.d.ts","sourceRoot":"","sources":["../../src/pd-button-select-group/PdButtonSelectGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,0CAA0C;IAE1C,OAAO,EAAE,UAAU,EAAE,CAAM;IAE3B,sCAAsC;IAEtC,SAAS,EAAE,MAAM,CAAM;IAEvB,2EAA2E;IAE3E,UAAU,SAAM;IAEhB,cAAc;IAEd,OAAO,CAAC,cAAc,CAAc;IAEpC,cAAc;IAEd,OAAO,CAAC,cAAc,CAAC,CAAuB;IAE9C,cAAc;IAEd,OAAO,CAAC,cAAc,CAAC,CAAuB;IAE9C,OAAgB,MAAM,EAAE,cAAc,CASpC;IAEO,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAOtD,KAAK,CAAC,aAAa,EAAE,MAAM;IAOzB,MAAM;IA0Bf,OAAO,CAAC,qBAAqB;CAkB9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html } from 'lit';
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { property, state, query } from 'lit/decorators.js';
|
|
3
3
|
import { PdBaseUI } from '../base/pd-base-ui.js';
|
|
4
4
|
import '../pd-panel-button.js';
|
|
@@ -18,6 +18,7 @@ class PdButtonSelectGroup extends PdBaseUI {
|
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.options = [];
|
|
20
20
|
this.initValue = -1;
|
|
21
|
+
this.groupLabel = "";
|
|
21
22
|
this._selectedValue = -1;
|
|
22
23
|
}
|
|
23
24
|
static {
|
|
@@ -27,18 +28,13 @@ class PdButtonSelectGroup extends PdBaseUI {
|
|
|
27
28
|
:host {
|
|
28
29
|
display: inline-block;
|
|
29
30
|
position: relative;
|
|
30
|
-
--pd-panel-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.button-group-style {
|
|
34
|
-
--pd-button-group-direction: column;
|
|
35
|
-
--pd-icon-button-justify: flex-start;
|
|
31
|
+
--pd-panel-padding: 0px;
|
|
36
32
|
}
|
|
37
33
|
`
|
|
38
34
|
];
|
|
39
35
|
}
|
|
40
36
|
willUpdate(changedProps) {
|
|
41
|
-
if (changedProps.has("initValue") && this.initValue
|
|
37
|
+
if (changedProps.has("initValue") && this.initValue >= 0) {
|
|
42
38
|
this._selectedValue = this.initValue;
|
|
43
39
|
}
|
|
44
40
|
}
|
|
@@ -50,31 +46,34 @@ class PdButtonSelectGroup extends PdBaseUI {
|
|
|
50
46
|
}
|
|
51
47
|
render() {
|
|
52
48
|
if (!this.options || this.options.length === 0) {
|
|
53
|
-
return
|
|
49
|
+
return nothing;
|
|
54
50
|
}
|
|
55
51
|
const selectedData = this.options[this._selectedValue === -1 ? 0 : this._selectedValue];
|
|
52
|
+
const isIconOnly = !selectedData?.text && !!selectedData?.pdIcon;
|
|
56
53
|
return html`
|
|
57
54
|
<pd-panel-button
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.
|
|
61
|
-
.
|
|
55
|
+
hide-close
|
|
56
|
+
?icon-only="${isIconOnly}"
|
|
57
|
+
.text="${selectedData?.text ?? ""}"
|
|
58
|
+
.icon="${selectedData?.pdIcon ?? ""}"
|
|
62
59
|
>
|
|
63
60
|
<pd-button-group
|
|
64
61
|
id="buttonGroupId"
|
|
65
|
-
|
|
66
|
-
.buttonList
|
|
67
|
-
.initValue
|
|
68
|
-
|
|
62
|
+
vertical
|
|
63
|
+
.buttonList="${this.options}"
|
|
64
|
+
.initValue="${[this._selectedValue]}"
|
|
65
|
+
.groupLabel="${this.groupLabel}"
|
|
66
|
+
@pd-button-group-change="${this.handleSelectionChange}"
|
|
69
67
|
></pd-button-group>
|
|
70
68
|
</pd-panel-button>
|
|
71
69
|
`;
|
|
72
70
|
}
|
|
73
71
|
handleSelectionChange(e) {
|
|
72
|
+
e.stopPropagation();
|
|
74
73
|
const [newIndex] = e.detail.selected;
|
|
75
74
|
this._selectedValue = newIndex;
|
|
76
|
-
e.stopPropagation();
|
|
77
75
|
window.dispatchEvent(new Event("close-button-panel-event"));
|
|
76
|
+
this._panelButtonEl?.focus();
|
|
78
77
|
this.dispatchEvent(
|
|
79
78
|
new CustomEvent("pd-button-selection-changed", {
|
|
80
79
|
detail: { selected: newIndex },
|
|
@@ -82,7 +81,6 @@ class PdButtonSelectGroup extends PdBaseUI {
|
|
|
82
81
|
composed: true
|
|
83
82
|
})
|
|
84
83
|
);
|
|
85
|
-
e.stopPropagation();
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
__decorateClass([
|
|
@@ -91,11 +89,17 @@ __decorateClass([
|
|
|
91
89
|
__decorateClass([
|
|
92
90
|
property({ type: Number })
|
|
93
91
|
], PdButtonSelectGroup.prototype, "initValue");
|
|
92
|
+
__decorateClass([
|
|
93
|
+
property({ type: String, attribute: "group-label" })
|
|
94
|
+
], PdButtonSelectGroup.prototype, "groupLabel");
|
|
94
95
|
__decorateClass([
|
|
95
96
|
state()
|
|
96
97
|
], PdButtonSelectGroup.prototype, "_selectedValue");
|
|
97
98
|
__decorateClass([
|
|
98
99
|
query("#buttonGroupId")
|
|
99
100
|
], PdButtonSelectGroup.prototype, "_buttonGroupEl");
|
|
101
|
+
__decorateClass([
|
|
102
|
+
query("pd-panel-button")
|
|
103
|
+
], PdButtonSelectGroup.prototype, "_panelButtonEl");
|
|
100
104
|
|
|
101
105
|
export { PdButtonSelectGroup };
|
|
@@ -1,21 +1,46 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { ButtonData } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-button-select-group component.
|
|
5
|
+
* Defines all configurable properties available in Storybook controls.
|
|
6
|
+
*/
|
|
7
|
+
interface PdButtonSelectGroupArgs {
|
|
8
|
+
/** Array of button options to display in the dropdown */
|
|
9
|
+
options: ButtonData[];
|
|
10
|
+
/** Index of the initially selected option (-1 for no selection) */
|
|
11
|
+
initValue: number;
|
|
12
|
+
/** Accessible label for the button group */
|
|
13
|
+
groupLabel: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ## pd-button-select-group
|
|
17
|
+
*
|
|
18
|
+
* A dropdown select component that combines a `pd-panel-button` with a
|
|
19
|
+
* `pd-button-group` to create a compact single-selection dropdown.
|
|
20
|
+
*
|
|
21
|
+
* ### Features
|
|
22
|
+
* - **Single Selection**: Only one option can be selected at a time
|
|
23
|
+
* - **Dropdown Panel**: Options appear in a panel when the button is clicked
|
|
24
|
+
* - **Icon Support**: Each option can have an optional icon
|
|
25
|
+
* - **Disabled Options**: Individual options can be disabled
|
|
26
|
+
* - **Auto-close**: Panel closes automatically after selection
|
|
27
|
+
*/
|
|
28
|
+
declare const meta: Meta<PdButtonSelectGroupArgs>;
|
|
16
29
|
export default meta;
|
|
17
|
-
type Story = StoryObj
|
|
30
|
+
type Story = StoryObj<PdButtonSelectGroupArgs>;
|
|
31
|
+
/**
|
|
32
|
+
* Default configuration with basic options.
|
|
33
|
+
* Click the button to open the dropdown panel.
|
|
34
|
+
*/
|
|
18
35
|
export declare const Default: Story;
|
|
19
|
-
|
|
20
|
-
export declare const
|
|
36
|
+
/** Options containing only text, no icons. Useful for simple selection scenarios. */
|
|
37
|
+
export declare const TextOnlyOptions: Story;
|
|
38
|
+
/** Options containing only icons, no text. Useful for compact icon-based controls. */
|
|
39
|
+
export declare const IconOnlyOptions: Story;
|
|
40
|
+
/** Dropdown with one disabled option. The "Word" option cannot be selected. */
|
|
41
|
+
export declare const WithDisabledOption: Story;
|
|
42
|
+
/** Extended list showing behavior with many options. */
|
|
43
|
+
export declare const ManyOptions: Story;
|
|
44
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
45
|
+
export declare const CustomStyling: Story;
|
|
21
46
|
//# sourceMappingURL=pd-button-select-group.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-button-select-group.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button-select-group/pd-button-select-group.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-button-select-group.stories.d.ts","sourceRoot":"","sources":["../../src/pd-button-select-group/pd-button-select-group.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC;;;GAGG;AACH,UAAU,uBAAuB;IAC/B,yDAAyD;IACzD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAiDD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,uBAAuB,CA0EvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAC;AAM/C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAMF,qFAAqF;AACrF,eAAO,MAAM,eAAe,EAAE,KAY7B,CAAC;AAMF,sFAAsF;AACtF,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,EAAE,KAKhC,CAAC;AAMF,wDAAwD;AACxD,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KAwF3B,CAAC"}
|
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
import { CSSResultGroup } from 'lit';
|
|
2
2
|
import { PdBaseUIInput } from '../base/pd-base-ui-input';
|
|
3
3
|
/**
|
|
4
|
+
* Checkbox, radio, or switch input component.
|
|
5
|
+
*
|
|
4
6
|
* @tagname pd-checkbox
|
|
7
|
+
* @summary Checkbox, radio button, or switch toggle input.
|
|
8
|
+
*
|
|
9
|
+
* @event pd-form-element-change - Fired when value changes. Detail: `{ value, name, parsedValue, state }`.
|
|
10
|
+
* @event enter-pressed - Fired when Enter key is pressed.
|
|
11
|
+
*
|
|
12
|
+
* @slot - Label text for the checkbox.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --pd-cb-col - Checked icon color.
|
|
15
|
+
* @cssprop --pd-cb-bg-col - Checked background color.
|
|
16
|
+
* @cssprop --pd-cb-unset-bg-col - Unchecked background color.
|
|
17
|
+
* @cssprop --pd-cb-border-col - Border color.
|
|
18
|
+
* @cssprop --pd-cb-border-col-readonly - Readonly border color.
|
|
19
|
+
* @cssprop --pd-cb-border-radius - Border radius.
|
|
20
|
+
* @cssprop --pd-cb-font-col - Label text color.
|
|
21
|
+
* @cssprop --pd-cb-font-col-readonly - Readonly label color.
|
|
22
|
+
* @cssprop --pd-cb-font-col-disabled - Disabled label color.
|
|
23
|
+
* @cssprop --pd-cb-switch-height - Switch variant height.
|
|
24
|
+
* @cssprop --pd-cb-switch-paddle-col - Switch paddle background.
|
|
5
25
|
*/
|
|
6
26
|
export declare class PdCheckbox extends PdBaseUIInput {
|
|
27
|
+
/** Display type: CHECK (default), RADIO, or SWITCH. */
|
|
7
28
|
checkType: "CHECK" | "RADIO" | "SWITCH";
|
|
8
29
|
static styles: CSSResultGroup;
|
|
9
30
|
constructor();
|
|
10
31
|
setCheckedState(newValue: "true" | "false"): void;
|
|
11
32
|
render(): import('lit').TemplateResult<1>;
|
|
12
33
|
private _onClick;
|
|
13
|
-
private
|
|
14
|
-
private _onLinkClick;
|
|
34
|
+
private _onKeyDown;
|
|
15
35
|
protected _getInitialValue(reset?: boolean): string;
|
|
16
36
|
clear(): void;
|
|
37
|
+
_getParsedValue(): boolean;
|
|
17
38
|
}
|
|
18
39
|
//# sourceMappingURL=PdCheckbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdCheckbox.d.ts","sourceRoot":"","sources":["../../src/pd-checkbox/PdCheckbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"PdCheckbox.d.ts","sourceRoot":"","sources":["../../src/pd-checkbox/PdCheckbox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAIhD,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,aAAa,EAAoB,MAAM,0BAA0B,CAAC;AAG3E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,UAAW,SAAQ,aAAa;IAC3C,uDAAuD;IAEvD,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAW;IAElD,OAAgB,MAAM,EAAE,cAAc,CA0OpC;;IAOK,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAI/C,MAAM;IAsDf,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,UAAU;IAqBlB,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM;IAM5C,KAAK,IAAI,IAAI;IAIX,eAAe;CAIzB"}
|