@ganpatiinfo/gids-web-dom-reference 2.0.8 → 2.0.9

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 (27) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/components/GidsButtonDock/GidsButtonDock.d.ts +7 -0
  3. package/dist/components/GidsButtonDock/GidsButtonDock.d.ts.map +1 -0
  4. package/dist/components/GidsButtonDock/GidsButtonDock.js +17 -0
  5. package/dist/components/GidsButtonDock/GidsButtonDock.js.map +1 -0
  6. package/dist/components/GidsButtonGroup/GidsButtonGroup.d.ts +7 -0
  7. package/dist/components/GidsButtonGroup/GidsButtonGroup.d.ts.map +1 -0
  8. package/dist/components/GidsButtonGroup/GidsButtonGroup.js +10 -0
  9. package/dist/components/GidsButtonGroup/GidsButtonGroup.js.map +1 -0
  10. package/dist/components/GidsCompoundButton/GidsCompoundButton.d.ts +9 -0
  11. package/dist/components/GidsCompoundButton/GidsCompoundButton.d.ts.map +1 -0
  12. package/dist/components/GidsCompoundButton/GidsCompoundButton.js +83 -0
  13. package/dist/components/GidsCompoundButton/GidsCompoundButton.js.map +1 -0
  14. package/dist/components/GidsSectionNotice/GidsSectionNotice.d.ts +7 -0
  15. package/dist/components/GidsSectionNotice/GidsSectionNotice.d.ts.map +1 -0
  16. package/dist/components/GidsSectionNotice/GidsSectionNotice.js +70 -0
  17. package/dist/components/GidsSectionNotice/GidsSectionNotice.js.map +1 -0
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +4 -0
  21. package/dist/index.js.map +1 -1
  22. package/package.json +3 -3
  23. package/src/components/GidsButtonDock/GidsButtonDock.ts +33 -0
  24. package/src/components/GidsButtonGroup/GidsButtonGroup.ts +26 -0
  25. package/src/components/GidsCompoundButton/GidsCompoundButton.ts +120 -0
  26. package/src/components/GidsSectionNotice/GidsSectionNotice.ts +105 -0
  27. package/src/index.ts +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ganpatiinfo/gids-web-dom-reference
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Added `ButtonDock`, `ButtonGroup`, `SectionNotice` and `CompoundButton`
8
+ - Updated dependencies
9
+ - Updated dependencies
10
+ - @ganpatiinfo/gids-core-shared@2.0.9
11
+ - @ganpatiinfo/gids-web-shared@2.0.9
12
+
3
13
  ## 2.0.8
4
14
 
5
15
  ### Patch Changes
@@ -0,0 +1,7 @@
1
+ import { type GidsButtonDockCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { type DomChildren } from '../../utils/domUtils.js';
3
+ export interface GidsButtonDockDomProps extends GidsButtonDockCommonProps<DomChildren> {
4
+ extraClasses?: string;
5
+ }
6
+ export declare const GidsButtonDockDom: ({ primaryChildren, secondaryChildren, extraClasses, }: GidsButtonDockDomProps) => HTMLDivElement;
7
+ //# sourceMappingURL=GidsButtonDock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsButtonDock.d.ts","sourceRoot":"","sources":["../../../src/components/GidsButtonDock/GidsButtonDock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI7E,MAAM,WAAW,sBAChB,SAAQ,yBAAyB,CAAC,WAAW,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,GAAI,uDAI/B,sBAAsB,KAAG,cAiB3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { GidsButtonDockWebUtils } from '@ganpatiinfo/gids-web-shared';
2
+ import { appendAsChildren } from '../../utils/domUtils.js';
3
+ const { getGidsButtonDockClassNames } = GidsButtonDockWebUtils;
4
+ export const GidsButtonDockDom = ({ primaryChildren, secondaryChildren, extraClasses, }) => {
5
+ const buttonDock = document.createElement('div');
6
+ buttonDock.className = getGidsButtonDockClassNames(extraClasses);
7
+ const primaryArea = document.createElement('div');
8
+ primaryArea.classList.add('gids-button-dock__primary-area');
9
+ const secondaryArea = document.createElement('div');
10
+ secondaryArea.classList.add('gids-button-dock__secondary-area');
11
+ appendAsChildren(primaryArea, primaryChildren);
12
+ appendAsChildren(secondaryArea, secondaryChildren);
13
+ appendAsChildren(buttonDock, secondaryArea);
14
+ appendAsChildren(buttonDock, primaryArea);
15
+ return buttonDock;
16
+ };
17
+ //# sourceMappingURL=GidsButtonDock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsButtonDock.js","sourceRoot":"","sources":["../../../src/components/GidsButtonDock/GidsButtonDock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,yBAAyB,CAAC;AAE7E,MAAM,EAAE,2BAA2B,EAAE,GAAG,sBAAsB,CAAC;AAO/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EACjC,eAAe,EACf,iBAAiB,EACjB,YAAY,GACY,EAAkB,EAAE;IAC5C,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,UAAU,CAAC,SAAS,GAAG,2BAA2B,CAAC,YAAY,CAAC,CAAC;IAEjE,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAE5D,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpD,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAEhE,gBAAgB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC/C,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAEnD,gBAAgB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC5C,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAE1C,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { GidsButtonGroupCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { DomChildren } from '../../utils/domUtils.js';
3
+ export interface GidsButtonGroupDomProps extends GidsButtonGroupCommonProps<DomChildren> {
4
+ extraClasses?: string;
5
+ }
6
+ export declare const GidsButtonGroupDom: ({ layout, children, extraClasses, }: GidsButtonGroupDomProps) => HTMLSpanElement;
7
+ //# sourceMappingURL=GidsButtonGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/GidsButtonGroup/GidsButtonGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAoB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAIxE,MAAM,WAAW,uBAChB,SAAQ,0BAA0B,CAAC,WAAW,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,GAAI,qCAIhC,uBAAuB,KAAG,eAU5B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { GidsButtonGroupWebUtils } from '@ganpatiinfo/gids-web-shared';
2
+ import { appendAsChildren } from '../../utils/domUtils.js';
3
+ const { getGidsButtonGroupClassNames } = GidsButtonGroupWebUtils;
4
+ export const GidsButtonGroupDom = ({ layout, children, extraClasses, }) => {
5
+ const buttonGroup = document.createElement('span');
6
+ buttonGroup.className = getGidsButtonGroupClassNames({ layout }, extraClasses);
7
+ appendAsChildren(buttonGroup, children);
8
+ return buttonGroup;
9
+ };
10
+ //# sourceMappingURL=GidsButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsButtonGroup.js","sourceRoot":"","sources":["../../../src/components/GidsButtonGroup/GidsButtonGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAe,MAAM,yBAAyB,CAAC;AAExE,MAAM,EAAE,4BAA4B,EAAE,GAAG,uBAAuB,CAAC;AAOjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,YAAY,GACa,EAAmB,EAAE;IAC9C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACnD,WAAW,CAAC,SAAS,GAAG,4BAA4B,CACnD,EAAE,MAAM,EAAE,EACV,YAAY,CACZ,CAAC;IAEF,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAExC,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type GidsCompoundButtonCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { DomNodeOrString } from '../../utils/domUtils.js';
3
+ export interface GidsCompoundButtonDomProps extends GidsCompoundButtonCommonProps<DomNodeOrString, DomNodeOrString> {
4
+ onClick?: (this: HTMLButtonElement, event: Event) => void;
5
+ onChangeCheckbox?: (event: Event) => void;
6
+ onChangeRadio?: (event: Event) => void;
7
+ }
8
+ export declare const GidsCompoundButtonDom: ({ children, leadingIcon, trailingContent, trailingContentDisabled, trailingContentIndeterminate, checked, disabled, onClick, onChangeCheckbox, onChangeRadio, }: GidsCompoundButtonDomProps) => HTMLButtonElement;
9
+ //# sourceMappingURL=GidsCompoundButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsCompoundButton.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCompoundButton/GidsCompoundButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAKnF,OAAO,EAAoB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAQ5E,MAAM,WAAW,0BAChB,SAAQ,6BAA6B,CAAC,eAAe,EAAE,eAAe,CAAC;IACvE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,qBAAqB,GAAI,iKAWnC,0BAA0B,KAAG,iBAwF/B,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { generateId, GidsCompoundButtonWebUtils, } from '@ganpatiinfo/gids-web-shared';
2
+ import { appendAsChildren } from '../../utils/domUtils.js';
3
+ import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
4
+ import { GidsCheckboxControlDom } from '../_GidsCheckboxControl/GidsCheckboxControl.js';
5
+ import { GidsRadioControlDom } from '../_GidsRadioControl/GidsRadioControl.js';
6
+ const { getGidsCompoundButtonClassNames } = GidsCompoundButtonWebUtils;
7
+ export const GidsCompoundButtonDom = ({ children, leadingIcon, trailingContent, trailingContentDisabled, trailingContentIndeterminate, checked, disabled, onClick, onChangeCheckbox, onChangeRadio, }) => {
8
+ const compoundButton = document.createElement('button');
9
+ compoundButton.className = getGidsCompoundButtonClassNames({
10
+ checked,
11
+ trailingContent,
12
+ disabled,
13
+ });
14
+ compoundButton.setAttribute('type', 'button');
15
+ if (disabled) {
16
+ compoundButton.setAttribute('disabled', '');
17
+ }
18
+ else {
19
+ compoundButton.removeAttribute('disabled');
20
+ }
21
+ const innerContainer = document.createElement('div');
22
+ innerContainer.className = 'gids-compound-button__inner-container';
23
+ if (leadingIcon &&
24
+ typeof leadingIcon === 'string' &&
25
+ leadingIcon !== '' &&
26
+ leadingIcon !== '(none)') {
27
+ const leadingIconEl = GidsIconDom({
28
+ size: 'md',
29
+ appearance: 'regular',
30
+ name: leadingIcon,
31
+ alt: '',
32
+ className: disabled
33
+ ? `gids-compound-button__leading-icon gids-compound-button__icon-disabled`
34
+ : `gids-compound-button__leading-icon`,
35
+ });
36
+ appendAsChildren(innerContainer, leadingIconEl);
37
+ }
38
+ const labelElement = document.createElement('div');
39
+ labelElement.className = disabled
40
+ ? 'gids-compound-button__label gids-compound-button__label-disabled'
41
+ : 'gids-compound-button__label';
42
+ appendAsChildren(labelElement, children);
43
+ innerContainer.appendChild(labelElement);
44
+ if (trailingContent === 'checkbox') {
45
+ const checkbox = GidsCheckboxControlDom({
46
+ checked: checked,
47
+ indeterminate: trailingContentIndeterminate,
48
+ disabled: trailingContentDisabled || disabled,
49
+ inputId: generateId(),
50
+ onChange: onChangeCheckbox,
51
+ });
52
+ innerContainer.appendChild(checkbox);
53
+ }
54
+ if (trailingContent === 'radio') {
55
+ const radio = GidsRadioControlDom({
56
+ checked: checked,
57
+ inputId: generateId(),
58
+ disabled: trailingContentDisabled || disabled,
59
+ onChange: onChangeRadio,
60
+ });
61
+ innerContainer.appendChild(radio);
62
+ }
63
+ if (trailingContent === 'disclosure') {
64
+ const trailingIcon = GidsIconDom({
65
+ size: 'md',
66
+ appearance: 'regular',
67
+ name: 'chevron-right',
68
+ alt: '',
69
+ className: disabled
70
+ ? `gids-compound-button__trailing-icon gids-compound-button__icon-disabled`
71
+ : `gids-compound-button__trailing-icon`,
72
+ });
73
+ innerContainer.appendChild(trailingIcon);
74
+ }
75
+ compoundButton.appendChild(innerContainer);
76
+ if (onClick &&
77
+ trailingContent !== 'checkbox' &&
78
+ trailingContent !== 'radio') {
79
+ compoundButton.addEventListener('click', onClick);
80
+ }
81
+ return compoundButton;
82
+ };
83
+ //# sourceMappingURL=GidsCompoundButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsCompoundButton.js","sourceRoot":"","sources":["../../../src/components/GidsCompoundButton/GidsCompoundButton.ts"],"names":[],"mappings":"AACA,O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EAAE,QAAQ;gBAClB,CAAC,CAAC,yEAAyE;gBAC3E,CAAC,CAAC,qCAAqC;SACxC,CAAC,CAAC;QACH,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IAED,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE3C,IACC,OAAO;QACP,eAAe,KAAK,UAAU;QAC9B,eAAe,KAAK,OAAO,EAC1B,CAAC;QACF,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type GidsSectionNoticeCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { type DomChildren, type DomNodeOrString } from '../../utils/domUtils.js';
3
+ export interface GidsSectionNoticeDomProps extends GidsSectionNoticeCommonProps<DomNodeOrString, DomChildren> {
4
+ onClickDismiss?: (event: MouseEvent) => void;
5
+ }
6
+ export declare const GidsSectionNoticeDom: ({ appearance, title, supportingText, children, dismissible, onClickDismiss, }: GidsSectionNoticeDomProps) => HTMLDivElement;
7
+ //# sourceMappingURL=GidsSectionNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsSectionNotice.d.ts","sourceRoot":"","sources":["../../../src/components/GidsSectionNotice/GidsSectionNotice.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,4BAA4B,EACjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,MAAM,yBAAyB,CAAC;AASjC,MAAM,WAAW,yBAChB,SAAQ,4BAA4B,CAAC,eAAe,EAAE,WAAW,CAAC;IAClE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,oBAAoB,GAAI,+EAOlC,yBAAyB,KAAG,cA0E9B,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { GidsSectionNoticeCommonUtils, } from '@ganpatiinfo/gids-core-shared';
2
+ import { GidsSectionNoticeWebUtils } from '@ganpatiinfo/gids-web-shared';
3
+ import { appendAsChildren, } from '../../utils/domUtils.js';
4
+ import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
5
+ import { GidsButtonDom } from '../GidsButton/GidsButton.js';
6
+ import { GidsButtonGroupDom } from '../GidsButtonGroup/GidsButtonGroup.js';
7
+ const { getGidsSectionNoticeClassNames } = GidsSectionNoticeWebUtils;
8
+ const { getSectionNoticeIconName } = GidsSectionNoticeCommonUtils;
9
+ export const GidsSectionNoticeDom = ({ appearance = 'information', title, supportingText, children, dismissible = true, onClickDismiss, }) => {
10
+ const sectionNotice = document.createElement('div');
11
+ sectionNotice.className = getGidsSectionNoticeClassNames({ appearance });
12
+ const innerContainer = document.createElement('div');
13
+ innerContainer.className = 'gids-section-notice__inner-container';
14
+ const leadingIconContainer = document.createElement('div');
15
+ leadingIconContainer.className =
16
+ 'gids-section-notice__leading-icon-container';
17
+ const leadingIconName = getSectionNoticeIconName({ appearance });
18
+ const leadingIcon = GidsIconDom({
19
+ size: 'md',
20
+ appearance: 'filled',
21
+ name: leadingIconName,
22
+ alt: '',
23
+ className: `gids-section-notice__${appearance}-icon`,
24
+ });
25
+ leadingIconContainer.appendChild(leadingIcon);
26
+ innerContainer.appendChild(leadingIconContainer);
27
+ const contentContainer = document.createElement('div');
28
+ contentContainer.className = 'gids-section-notice__content-container';
29
+ const titleElement = document.createElement('div');
30
+ titleElement.className = 'gids-section-notice__title';
31
+ appendAsChildren(titleElement, title);
32
+ contentContainer.appendChild(titleElement);
33
+ if (supportingText) {
34
+ const supportingTextElement = document.createElement('div');
35
+ supportingTextElement.className = 'gids-section-notice__supporting-text';
36
+ appendAsChildren(supportingTextElement, supportingText);
37
+ contentContainer.appendChild(supportingTextElement);
38
+ }
39
+ if (children) {
40
+ contentContainer.appendChild(GidsButtonGroupDom({
41
+ layout: 'wrap',
42
+ children: children,
43
+ }));
44
+ }
45
+ innerContainer.appendChild(contentContainer);
46
+ if (dismissible && onClickDismiss) {
47
+ const leadingIcon = GidsIconDom({
48
+ size: 'sm',
49
+ appearance: 'filled',
50
+ name: 'cross',
51
+ alt: '',
52
+ });
53
+ const crossButton = GidsButtonDom({
54
+ as: 'button',
55
+ type: 'button',
56
+ appearance: 'subtle',
57
+ size: 'sm',
58
+ width: 'intrinsic',
59
+ leadingIcon: leadingIcon,
60
+ });
61
+ crossButton.addEventListener('click', onClickDismiss);
62
+ const crossBtnContainer = document.createElement('div');
63
+ crossBtnContainer.className = 'gids-section-notice__cross-button-container';
64
+ crossBtnContainer.appendChild(crossButton);
65
+ innerContainer.appendChild(crossBtnContainer);
66
+ }
67
+ sectionNotice.appendChild(innerContainer);
68
+ return sectionNotice;
69
+ };
70
+ //# sourceMappingURL=GidsSectionNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GidsSectionNotice.js","sourceRoot":"","sources":["../../../src/components/GidsSectionNotice/GidsSectionNotice.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,GAE5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EACN,gBAAgB,GAGhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,EAAE,8BAA8B,EAAE,GAAG,yBAAyB,CAAC;AACrE,MAAM,EAAE,wBAAwB,EAAE,GAAG,4BAA4B,CAAC;AAOlE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EACpC,UAAU,GAAG,aAAa,EAC1B,KAAK,EACL,cAAc,EACd,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,cAAc,GACa,EA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E,gBAAgB,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;QACxD,gBAAgB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,WAAW,CAC3B,kBAAkB,CAAC;YAClB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,QAAQ;SAClB,CAAC,CACF,CAAC;IACH,CAAC;IAED,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,WAAW,IAAI,cAAc,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,WAAW,CAAC;YAC/B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,QAAQ;YACpB,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,EAAE;SACP,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,aAAa,CAAC;YACjC,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,QAAQ;YACpB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,WAAW;SACxB,CAAC,CAAC;QACH,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACtD,MAAM,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,iBAAiB,CAAC,SAAS,GAAG,6CAA6C,CAAC;QAC5E,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC3C,cAAc,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC/C,CAAC;IAED,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE1C,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -26,6 +26,10 @@ export * from './components/GidsAvatarGroup/GidsAvatarGroup.js';
26
26
  export * from './components/GidsTagGroup/GidsTagGroup.js';
27
27
  export * from './components/GidsInputTag/_GidsInputTagButton/GidsInputTagButton.js';
28
28
  export * from './components/GidsInputTag/GidsInputTag.js';
29
+ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
30
+ export * from './components/GidsButtonDock/GidsButtonDock.js';
31
+ export * from './components/GidsSectionNotice/GidsSectionNotice.js';
32
+ export * from './components/GidsCompoundButton/GidsCompoundButton.js';
29
33
  /**
30
34
  * Utilities
31
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAE1D;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AAEtE;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -26,6 +26,10 @@ export * from './components/GidsAvatarGroup/GidsAvatarGroup.js';
26
26
  export * from './components/GidsTagGroup/GidsTagGroup.js';
27
27
  export * from './components/GidsInputTag/_GidsInputTagButton/GidsInputTagButton.js';
28
28
  export * from './components/GidsInputTag/GidsInputTag.js';
29
+ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
30
+ export * from './components/GidsButtonDock/GidsButtonDock.js';
31
+ export * from './components/GidsSectionNotice/GidsSectionNotice.js';
32
+ export * from './components/GidsCompoundButton/GidsCompoundButton.js';
29
33
  /**
30
34
  * Utilities
31
35
  */
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAA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AA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AAEtE;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganpatiinfo/gids-web-dom-reference",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "private": false,
5
5
  "description": "DOM for components reference implementations",
6
6
  "homepage": "https://ganpatiinfosystem.vercel.app/",
@@ -24,8 +24,8 @@
24
24
  "directory": "packages/private/web-dom-reference"
25
25
  },
26
26
  "dependencies": {
27
- "@ganpatiinfo/gids-core-shared": "2.0.8",
28
- "@ganpatiinfo/gids-web-shared": "2.0.8"
27
+ "@ganpatiinfo/gids-core-shared": "2.0.9",
28
+ "@ganpatiinfo/gids-web-shared": "2.0.9"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@ganpatiinfo/gids-web-theme-interface": "2.0.7",
@@ -0,0 +1,33 @@
1
+ import { type GidsButtonDockCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { GidsButtonDockWebUtils } from '@ganpatiinfo/gids-web-shared';
3
+ import { appendAsChildren, type DomChildren } from '../../utils/domUtils.js';
4
+
5
+ const { getGidsButtonDockClassNames } = GidsButtonDockWebUtils;
6
+
7
+ export interface GidsButtonDockDomProps
8
+ extends GidsButtonDockCommonProps<DomChildren> {
9
+ extraClasses?: string;
10
+ }
11
+
12
+ export const GidsButtonDockDom = ({
13
+ primaryChildren,
14
+ secondaryChildren,
15
+ extraClasses,
16
+ }: GidsButtonDockDomProps): HTMLDivElement => {
17
+ const buttonDock = document.createElement('div');
18
+ buttonDock.className = getGidsButtonDockClassNames(extraClasses);
19
+
20
+ const primaryArea = document.createElement('div');
21
+ primaryArea.classList.add('gids-button-dock__primary-area');
22
+
23
+ const secondaryArea = document.createElement('div');
24
+ secondaryArea.classList.add('gids-button-dock__secondary-area');
25
+
26
+ appendAsChildren(primaryArea, primaryChildren);
27
+ appendAsChildren(secondaryArea, secondaryChildren);
28
+
29
+ appendAsChildren(buttonDock, secondaryArea);
30
+ appendAsChildren(buttonDock, primaryArea);
31
+
32
+ return buttonDock;
33
+ };
@@ -0,0 +1,26 @@
1
+ import { GidsButtonGroupCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import { GidsButtonGroupWebUtils } from '@ganpatiinfo/gids-web-shared';
3
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
4
+
5
+ const { getGidsButtonGroupClassNames } = GidsButtonGroupWebUtils;
6
+
7
+ export interface GidsButtonGroupDomProps
8
+ extends GidsButtonGroupCommonProps<DomChildren> {
9
+ extraClasses?: string;
10
+ }
11
+
12
+ export const GidsButtonGroupDom = ({
13
+ layout,
14
+ children,
15
+ extraClasses,
16
+ }: GidsButtonGroupDomProps): HTMLSpanElement => {
17
+ const buttonGroup = document.createElement('span');
18
+ buttonGroup.className = getGidsButtonGroupClassNames(
19
+ { layout },
20
+ extraClasses,
21
+ );
22
+
23
+ appendAsChildren(buttonGroup, children);
24
+
25
+ return buttonGroup;
26
+ };
@@ -0,0 +1,120 @@
1
+ import { type GidsCompoundButtonCommonProps } from '@ganpatiinfo/gids-core-shared';
2
+ import {
3
+ generateId,
4
+ GidsCompoundButtonWebUtils,
5
+ } from '@ganpatiinfo/gids-web-shared';
6
+ import { appendAsChildren, DomNodeOrString } from '../../utils/domUtils.js';
7
+ import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
8
+ import { GidsCheckboxControlDom } from '../_GidsCheckboxControl/GidsCheckboxControl.js';
9
+ import { GidsRadioControlDom } from '../_GidsRadioControl/GidsRadioControl.js';
10
+ import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
11
+
12
+ const { getGidsCompoundButtonClassNames } = GidsCompoundButtonWebUtils;
13
+
14
+ export interface GidsCompoundButtonDomProps
15
+ extends GidsCompoundButtonCommonProps<DomNodeOrString, DomNodeOrString> {
16
+ onClick?: (this: HTMLButtonElement, event: Event) => void;
17
+ onChangeCheckbox?: (event: Event) => void;
18
+ onChangeRadio?: (event: Event) => void;
19
+ }
20
+
21
+ export const GidsCompoundButtonDom = ({
22
+ children,
23
+ leadingIcon,
24
+ trailingContent,
25
+ trailingContentDisabled,
26
+ trailingContentIndeterminate,
27
+ checked,
28
+ disabled,
29
+ onClick,
30
+ onChangeCheckbox,
31
+ onChangeRadio,
32
+ }: GidsCompoundButtonDomProps): HTMLButtonElement => {
33
+ const compoundButton = document.createElement('button');
34
+ compoundButton.className = getGidsCompoundButtonClassNames({
35
+ checked,
36
+ trailingContent,
37
+ disabled,
38
+ });
39
+
40
+ compoundButton.setAttribute('type', 'button');
41
+ if (disabled) {
42
+ compoundButton.setAttribute('disabled', '');
43
+ } else {
44
+ compoundButton.removeAttribute('disabled');
45
+ }
46
+
47
+ const innerContainer = document.createElement('div');
48
+ innerContainer.className = 'gids-compound-button__inner-container';
49
+
50
+ if (
51
+ leadingIcon &&
52
+ typeof leadingIcon === 'string' &&
53
+ leadingIcon !== '' &&
54
+ leadingIcon !== '(none)'
55
+ ) {
56
+ const leadingIconEl = GidsIconDom({
57
+ size: 'md',
58
+ appearance: 'regular',
59
+ name: leadingIcon as IconName,
60
+ alt: '',
61
+ className: disabled
62
+ ? `gids-compound-button__leading-icon gids-compound-button__icon-disabled`
63
+ : `gids-compound-button__leading-icon`,
64
+ });
65
+ appendAsChildren(innerContainer, leadingIconEl);
66
+ }
67
+
68
+ const labelElement = document.createElement('div');
69
+ labelElement.className = disabled
70
+ ? 'gids-compound-button__label gids-compound-button__label-disabled'
71
+ : 'gids-compound-button__label';
72
+ appendAsChildren(labelElement, children);
73
+ innerContainer.appendChild(labelElement);
74
+
75
+ if (trailingContent === 'checkbox') {
76
+ const checkbox = GidsCheckboxControlDom({
77
+ checked: checked,
78
+ indeterminate: trailingContentIndeterminate,
79
+ disabled: trailingContentDisabled || disabled,
80
+ inputId: generateId(),
81
+ onChange: onChangeCheckbox,
82
+ });
83
+ innerContainer.appendChild(checkbox);
84
+ }
85
+
86
+ if (trailingContent === 'radio') {
87
+ const radio = GidsRadioControlDom({
88
+ checked: checked,
89
+ inputId: generateId(),
90
+ disabled: trailingContentDisabled || disabled,
91
+ onChange: onChangeRadio,
92
+ });
93
+ innerContainer.appendChild(radio);
94
+ }
95
+
96
+ if (trailingContent === 'disclosure') {
97
+ const trailingIcon = GidsIconDom({
98
+ size: 'md',
99
+ appearance: 'regular',
100
+ name: 'chevron-right',
101
+ alt: '',
102
+ className: disabled
103
+ ? `gids-compound-button__trailing-icon gids-compound-button__icon-disabled`
104
+ : `gids-compound-button__trailing-icon`,
105
+ });
106
+ innerContainer.appendChild(trailingIcon);
107
+ }
108
+
109
+ compoundButton.appendChild(innerContainer);
110
+
111
+ if (
112
+ onClick &&
113
+ trailingContent !== 'checkbox' &&
114
+ trailingContent !== 'radio'
115
+ ) {
116
+ compoundButton.addEventListener('click', onClick);
117
+ }
118
+
119
+ return compoundButton;
120
+ };
@@ -0,0 +1,105 @@
1
+ import {
2
+ GidsSectionNoticeCommonUtils,
3
+ type GidsSectionNoticeCommonProps,
4
+ } from '@ganpatiinfo/gids-core-shared';
5
+ import { GidsSectionNoticeWebUtils } from '@ganpatiinfo/gids-web-shared';
6
+ import {
7
+ appendAsChildren,
8
+ type DomChildren,
9
+ type DomNodeOrString,
10
+ } from '../../utils/domUtils.js';
11
+ import { type IconName } from '@ganpatiinfo/gids-web-theme-interface';
12
+ import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
13
+ import { GidsButtonDom } from '../GidsButton/GidsButton.js';
14
+ import { GidsButtonGroupDom } from '../GidsButtonGroup/GidsButtonGroup.js';
15
+
16
+ const { getGidsSectionNoticeClassNames } = GidsSectionNoticeWebUtils;
17
+ const { getSectionNoticeIconName } = GidsSectionNoticeCommonUtils;
18
+
19
+ export interface GidsSectionNoticeDomProps
20
+ extends GidsSectionNoticeCommonProps<DomNodeOrString, DomChildren> {
21
+ onClickDismiss?: (event: MouseEvent) => void;
22
+ }
23
+
24
+ export const GidsSectionNoticeDom = ({
25
+ appearance = 'information',
26
+ title,
27
+ supportingText,
28
+ children,
29
+ dismissible = true,
30
+ onClickDismiss,
31
+ }: GidsSectionNoticeDomProps): HTMLDivElement => {
32
+ const sectionNotice = document.createElement('div');
33
+ sectionNotice.className = getGidsSectionNoticeClassNames({ appearance });
34
+
35
+ const innerContainer = document.createElement('div');
36
+ innerContainer.className = 'gids-section-notice__inner-container';
37
+
38
+ const leadingIconContainer = document.createElement('div');
39
+ leadingIconContainer.className =
40
+ 'gids-section-notice__leading-icon-container';
41
+
42
+ const leadingIconName = getSectionNoticeIconName({ appearance }) as IconName;
43
+
44
+ const leadingIcon = GidsIconDom({
45
+ size: 'md',
46
+ appearance: 'filled',
47
+ name: leadingIconName,
48
+ alt: '',
49
+ className: `gids-section-notice__${appearance}-icon`,
50
+ });
51
+ leadingIconContainer.appendChild(leadingIcon);
52
+ innerContainer.appendChild(leadingIconContainer);
53
+
54
+ const contentContainer = document.createElement('div');
55
+ contentContainer.className = 'gids-section-notice__content-container';
56
+
57
+ const titleElement = document.createElement('div');
58
+ titleElement.className = 'gids-section-notice__title';
59
+ appendAsChildren(titleElement, title);
60
+ contentContainer.appendChild(titleElement);
61
+
62
+ if (supportingText) {
63
+ const supportingTextElement = document.createElement('div');
64
+ supportingTextElement.className = 'gids-section-notice__supporting-text';
65
+ appendAsChildren(supportingTextElement, supportingText);
66
+ contentContainer.appendChild(supportingTextElement);
67
+ }
68
+
69
+ if (children) {
70
+ contentContainer.appendChild(
71
+ GidsButtonGroupDom({
72
+ layout: 'wrap',
73
+ children: children,
74
+ }),
75
+ );
76
+ }
77
+
78
+ innerContainer.appendChild(contentContainer);
79
+
80
+ if (dismissible && onClickDismiss) {
81
+ const leadingIcon = GidsIconDom({
82
+ size: 'sm',
83
+ appearance: 'filled',
84
+ name: 'cross',
85
+ alt: '',
86
+ });
87
+ const crossButton = GidsButtonDom({
88
+ as: 'button',
89
+ type: 'button',
90
+ appearance: 'subtle',
91
+ size: 'sm',
92
+ width: 'intrinsic',
93
+ leadingIcon: leadingIcon,
94
+ });
95
+ crossButton.addEventListener('click', onClickDismiss);
96
+ const crossBtnContainer = document.createElement('div');
97
+ crossBtnContainer.className = 'gids-section-notice__cross-button-container';
98
+ crossBtnContainer.appendChild(crossButton);
99
+ innerContainer.appendChild(crossBtnContainer);
100
+ }
101
+
102
+ sectionNotice.appendChild(innerContainer);
103
+
104
+ return sectionNotice;
105
+ };
package/src/index.ts CHANGED
@@ -26,6 +26,10 @@ export * from './components/GidsAvatarGroup/GidsAvatarGroup.js';
26
26
  export * from './components/GidsTagGroup/GidsTagGroup.js';
27
27
  export * from './components/GidsInputTag/_GidsInputTagButton/GidsInputTagButton.js';
28
28
  export * from './components/GidsInputTag/GidsInputTag.js';
29
+ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
30
+ export * from './components/GidsButtonDock/GidsButtonDock.js';
31
+ export * from './components/GidsSectionNotice/GidsSectionNotice.js';
32
+ export * from './components/GidsCompoundButton/GidsCompoundButton.js';
29
33
 
30
34
  /**
31
35
  * Utilities