@govtechsg/sgds-web-component 0.0.10 → 0.0.12
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/README.md +102 -10
- package/base/card-element.d.ts +12 -0
- package/{lib/utils → base}/dropdown-element.d.ts +38 -37
- package/{lib/utils → base}/link-element.d.ts +8 -7
- package/{lib/utils → base}/sgds-element.d.ts +6 -5
- package/components/Accordion/index.d.ts +2 -0
- package/components/Accordion/sgds-accordion-item.d.ts +40 -0
- package/components/Accordion/sgds-accordion.d.ts +19 -0
- package/components/ActionCard/index.d.ts +1 -0
- package/{lib/Card → components/ActionCard}/sgds-action-card.d.ts +21 -20
- package/components/Alert/index.d.ts +1 -0
- package/components/Alert/sgds-alert.d.ts +37 -0
- package/components/Badge/index.d.ts +1 -0
- package/components/Badge/sgds-badge.d.ts +10 -0
- package/components/Breadcrumb/index.d.ts +2 -0
- package/components/Breadcrumb/sgds-breadcrumb-item.d.ts +10 -0
- package/components/Breadcrumb/sgds-breadcrumb.d.ts +12 -0
- package/components/Button/index.d.ts +1 -0
- package/{lib → components}/Button/sgds-button.d.ts +55 -48
- package/components/Checkbox/index.d.ts +1 -0
- package/{lib → components}/Checkbox/sgds-checkbox.d.ts +36 -36
- package/components/CloseButton/index.d.ts +1 -0
- package/components/CloseButton/sgds-closebutton.d.ts +9 -0
- package/components/Dropdown/index.d.ts +3 -0
- package/{lib → components}/Dropdown/sgds-dropdown-item.d.ts +8 -7
- package/{lib → components}/Dropdown/sgds-dropdown.d.ts +8 -7
- package/components/FileUpload/index.d.ts +1 -0
- package/components/FileUpload/sgds-fileupload.d.ts +22 -0
- package/components/Footer/index.d.ts +1 -0
- package/{lib → components}/Footer/sgds-footer.d.ts +27 -23
- package/components/Input/index.d.ts +1 -0
- package/{lib → components}/Input/sgds-input.d.ts +42 -42
- package/components/Mainnav/index.d.ts +3 -0
- package/components/Mainnav/sgds-mainnav-dropdown.d.ts +6 -0
- package/components/Mainnav/sgds-mainnav-item.d.ts +8 -0
- package/{lib → components}/Mainnav/sgds-mainnav.d.ts +26 -22
- package/components/Masthead/index.d.ts +1 -0
- package/{lib → components}/Masthead/sgds-masthead.d.ts +9 -12
- package/components/Modal/index.d.ts +1 -0
- package/{lib → components}/Modal/sgds-modal.d.ts +28 -28
- package/components/QuantityToggle/index.d.ts +1 -0
- package/{lib/QuantityToggle/sgds-quantitytoggle.d.ts → components/QuantityToggle/sgds-quantity-toggle.d.ts} +30 -30
- package/components/Radio/index.d.ts +2 -0
- package/{lib/Radio/sgds-radiogroup.d.ts → components/Radio/sgds-radio-group.d.ts} +41 -41
- package/{lib → components}/Radio/sgds-radio.d.ts +31 -31
- package/components/Sidenav/index.d.ts +3 -0
- package/{lib → components}/Sidenav/sgds-sidenav-item.d.ts +36 -28
- package/components/Sidenav/sgds-sidenav-link.d.ts +8 -0
- package/{lib → components}/Sidenav/sgds-sidenav.d.ts +10 -6
- package/components/Stepper/index.d.ts +1 -0
- package/components/Stepper/sgds-stepper.d.ts +17 -0
- package/components/Tab/index.d.ts +3 -0
- package/{lib → components}/Tab/sgds-tab.d.ts +27 -26
- package/{lib → components}/Tab/sgds-tabgroup.d.ts +48 -47
- package/{lib → components}/Tab/sgds-tabpanel.d.ts +26 -25
- package/components/Table/index.d.ts +1 -0
- package/components/Table/sgds-table.d.ts +26 -0
- package/components/Textarea/index.d.ts +1 -0
- package/{lib → components}/Textarea/sgds-textarea.d.ts +53 -53
- package/components/Toast/index.d.ts +1 -0
- package/components/Toast/sgds-toast.d.ts +22 -0
- package/components/Tooltip/index.d.ts +1 -0
- package/components/Tooltip/sgds-tooltip.d.ts +30 -0
- package/index.d.ts +23 -0
- package/index.js +11543 -0
- package/index.js.map +1 -0
- package/main.d.ts +24 -0
- package/package.json +23 -65
- package/react/accordion/index.d.ts +3 -0
- package/react/accordion-item/index.d.ts +8 -0
- package/react/action-card/index.d.ts +3 -0
- package/react/alert/index.d.ts +3 -0
- package/react/badge/index.d.ts +3 -0
- package/react/breadcrumb/index.d.ts +3 -0
- package/react/breadcrumb-item/index.d.ts +3 -0
- package/react/button/index.d.ts +6 -0
- package/react/checkbox/index.d.ts +3 -0
- package/react/cjs/index.js +12510 -0
- package/react/cjs/index.js.map +1 -0
- package/react/closebutton/index.d.ts +5 -0
- package/react/dropdown/index.d.ts +3 -0
- package/react/dropdown-item/index.d.ts +3 -0
- package/react/fileupload/index.d.ts +3 -0
- package/react/footer/index.d.ts +3 -0
- package/react/index.d.ts +34 -0
- package/react/index.js +12453 -0
- package/react/index.js.map +1 -0
- package/react/input/index.d.ts +3 -0
- package/react/mainnav/index.d.ts +3 -0
- package/react/mainnav-dropdown/index.d.ts +3 -0
- package/react/mainnav-item/index.d.ts +3 -0
- package/react/masthead/index.d.ts +3 -0
- package/react/modal/index.d.ts +3 -0
- package/react/package.json +10 -0
- package/react/quantity-toggle/index.d.ts +3 -0
- package/react/radio/index.d.ts +3 -0
- package/react/radio-group/index.d.ts +3 -0
- package/react/sidenav/index.d.ts +3 -0
- package/react/sidenav-item/index.d.ts +5 -0
- package/react/sidenav-link/index.d.ts +3 -0
- package/react/stepper/index.d.ts +3 -0
- package/react/tab/index.d.ts +3 -0
- package/react/tab-group/index.d.ts +3 -0
- package/react/tab-panel/index.d.ts +3 -0
- package/react/table/index.d.ts +3 -0
- package/react/textarea/index.d.ts +3 -0
- package/react/toast/index.d.ts +3 -0
- package/react/tooltip/index.d.ts +3 -0
- package/umd/index.js +11995 -0
- package/umd/index.js.map +1 -0
- package/{lib/utils → utils}/animate.d.ts +10 -10
- package/{lib/utils → utils}/animation-registry.d.ts +18 -18
- package/{lib/utils → utils}/breakpoints.d.ts +5 -5
- package/{lib/utils → utils}/defaultvalue.d.ts +2 -2
- package/{lib/utils → utils}/event.d.ts +2 -2
- package/{lib/utils → utils}/form.d.ts +38 -38
- package/{lib/utils → utils}/generateId.d.ts +1 -1
- package/{lib/utils → utils}/mergeDeep.d.ts +2 -2
- package/{lib/utils → utils}/modal.d.ts +12 -12
- package/{lib/utils → utils}/object.d.ts +2 -2
- package/{lib/utils → utils}/offset.d.ts +4 -4
- package/{lib/utils → utils}/scroll.d.ts +13 -13
- package/{lib/utils → utils}/slot.d.ts +22 -22
- package/{lib/utils → utils}/tabbable.d.ts +8 -8
- package/{lib/utils → utils}/watch.d.ts +14 -14
- package/.github/workflows/publish-latest.yml +0 -22
- package/.github/workflows/publish-pr.yml +0 -28
- package/.husky/commit-msg +0 -4
- package/.husky/prepare-commit-msg +0 -8
- package/.storybook/main.js +0 -16
- package/.storybook/preview-head.html +0 -11
- package/.storybook/preview.js +0 -9
- package/.vscode/settings.json +0 -7
- package/CONTRIBUTING.md +0 -56
- package/LICENSE +0 -20
- package/amplify.yml +0 -22
- package/commitlint.config.js +0 -1
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/button-element.scss.html +0 -112
- package/coverage/lcov-report/button-element.ts.html +0 -145
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -116
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -32
- package/index.html +0 -430
- package/lib/Button/index.d.ts +0 -1
- package/lib/Button/index.js +0 -6634
- package/lib/Button/index.js.map +0 -1
- package/lib/Button/package.json +0 -7
- package/lib/Card/index.d.ts +0 -1
- package/lib/Card/index.js +0 -6150
- package/lib/Card/index.js.map +0 -1
- package/lib/Card/package.json +0 -7
- package/lib/Checkbox/index.d.ts +0 -1
- package/lib/Checkbox/index.js +0 -6366
- package/lib/Checkbox/index.js.map +0 -1
- package/lib/Checkbox/package.json +0 -7
- package/lib/Dropdown/index.d.ts +0 -3
- package/lib/Dropdown/index.js +0 -13502
- package/lib/Dropdown/index.js.map +0 -1
- package/lib/Dropdown/package.json +0 -7
- package/lib/Footer/index.d.ts +0 -2
- package/lib/Footer/index.js +0 -7168
- package/lib/Footer/index.js.map +0 -1
- package/lib/Footer/package.json +0 -7
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +0 -6656
- package/lib/Input/index.js.map +0 -1
- package/lib/Input/package.json +0 -7
- package/lib/Mainnav/index.d.ts +0 -4
- package/lib/Mainnav/index.js +0 -32546
- package/lib/Mainnav/index.js.map +0 -1
- package/lib/Mainnav/package.json +0 -7
- package/lib/Mainnav/sgds-mainnav-dropdown.d.ts +0 -5
- package/lib/Mainnav/sgds-mainnav-item.d.ts +0 -4
- package/lib/Masthead/index.d.ts +0 -1
- package/lib/Masthead/index.js +0 -7371
- package/lib/Masthead/index.js.map +0 -1
- package/lib/Masthead/package.json +0 -7
- package/lib/Modal/index.d.ts +0 -1
- package/lib/Modal/index.js +0 -6432
- package/lib/Modal/index.js.map +0 -1
- package/lib/Modal/package.json +0 -7
- package/lib/QuantityToggle/index.d.ts +0 -1
- package/lib/QuantityToggle/index.js +0 -7049
- package/lib/QuantityToggle/index.js.map +0 -1
- package/lib/QuantityToggle/package.json +0 -7
- package/lib/Radio/index.d.ts +0 -2
- package/lib/Radio/index.js +0 -12607
- package/lib/Radio/index.js.map +0 -1
- package/lib/Radio/package.json +0 -7
- package/lib/Sidenav/index.d.ts +0 -3
- package/lib/Sidenav/index.js +0 -18739
- package/lib/Sidenav/index.js.map +0 -1
- package/lib/Sidenav/package.json +0 -7
- package/lib/Sidenav/sgds-sidenav-link.d.ts +0 -4
- package/lib/Tab/index.d.ts +0 -3
- package/lib/Tab/index.js +0 -13557
- package/lib/Tab/index.js.map +0 -1
- package/lib/Tab/package.json +0 -7
- package/lib/Textarea/index.d.ts +0 -1
- package/lib/Textarea/index.js +0 -6696
- package/lib/Textarea/index.js.map +0 -1
- package/lib/Textarea/package.json +0 -7
- package/lib/index.d.ts +0 -16
- package/lib/index.js +0 -134580
- package/lib/index.js.map +0 -1
- package/lib/umd/index.js +0 -134587
- package/lib/umd/index.js.map +0 -1
- package/lib/utils/card-element.d.ts +0 -11
- package/mocks/dropdown.d.ts +0 -4
- package/mocks/dropdown.ts +0 -27
- package/mocks/link.d.ts +0 -3
- package/mocks/link.ts +0 -6
- package/rollup.config.js +0 -73
- package/rollup.test.config.js +0 -42
- package/scripts/buildUtils.js +0 -30
- package/scripts/frankBuild.js +0 -49
- package/src/Button/index.ts +0 -1
- package/src/Button/sgds-button.scss +0 -28
- package/src/Button/sgds-button.ts +0 -153
- package/src/Card/index.ts +0 -1
- package/src/Card/sgds-action-card.scss +0 -27
- package/src/Card/sgds-action-card.ts +0 -115
- package/src/Checkbox/index.ts +0 -1
- package/src/Checkbox/sgds-checkbox.scss +0 -4
- package/src/Checkbox/sgds-checkbox.ts +0 -149
- package/src/Dropdown/index.ts +0 -3
- package/src/Dropdown/sgds-dropdown-item.ts +0 -39
- package/src/Dropdown/sgds-dropdown.scss +0 -5
- package/src/Dropdown/sgds-dropdown.ts +0 -54
- package/src/Footer/index.ts +0 -3
- package/src/Footer/sgds-footer.scss +0 -5
- package/src/Footer/sgds-footer.ts +0 -121
- package/src/Input/index.ts +0 -1
- package/src/Input/sgds-input.scss +0 -20
- package/src/Input/sgds-input.ts +0 -178
- package/src/Mainnav/index.ts +0 -4
- package/src/Mainnav/sgds-mainnav-dropdown.scss +0 -13
- package/src/Mainnav/sgds-mainnav-dropdown.ts +0 -45
- package/src/Mainnav/sgds-mainnav-item.scss +0 -24
- package/src/Mainnav/sgds-mainnav-item.ts +0 -8
- package/src/Mainnav/sgds-mainnav.scss +0 -39
- package/src/Mainnav/sgds-mainnav.ts +0 -183
- package/src/Masthead/index.ts +0 -1
- package/src/Masthead/sgds-masthead.scss +0 -217
- package/src/Masthead/sgds-masthead.ts +0 -189
- package/src/Modal/index.ts +0 -1
- package/src/Modal/sgds-modal.scss +0 -128
- package/src/Modal/sgds-modal.ts +0 -309
- package/src/QuantityToggle/index.ts +0 -1
- package/src/QuantityToggle/sgds-quantitytoggle.scss +0 -10
- package/src/QuantityToggle/sgds-quantitytoggle.ts +0 -130
- package/src/Radio/index.ts +0 -2
- package/src/Radio/sgds-radio.scss +0 -5
- package/src/Radio/sgds-radio.ts +0 -120
- package/src/Radio/sgds-radiogroup.scss +0 -22
- package/src/Radio/sgds-radiogroup.ts +0 -221
- package/src/Sidenav/index.ts +0 -4
- package/src/Sidenav/sgds-sidenav-item.scss +0 -73
- package/src/Sidenav/sgds-sidenav-item.ts +0 -145
- package/src/Sidenav/sgds-sidenav-link.scss +0 -25
- package/src/Sidenav/sgds-sidenav-link.ts +0 -8
- package/src/Sidenav/sgds-sidenav.scss +0 -6
- package/src/Sidenav/sgds-sidenav.ts +0 -33
- package/src/Tab/index.ts +0 -3
- package/src/Tab/sgds-tab.scss +0 -84
- package/src/Tab/sgds-tab.ts +0 -87
- package/src/Tab/sgds-tabgroup.scss +0 -198
- package/src/Tab/sgds-tabgroup.ts +0 -295
- package/src/Tab/sgds-tabpanel.scss +0 -12
- package/src/Tab/sgds-tabpanel.ts +0 -55
- package/src/Textarea/index.ts +0 -1
- package/src/Textarea/sgds-textarea.scss +0 -23
- package/src/Textarea/sgds-textarea.ts +0 -201
- package/src/index.ts +0 -16
- package/src/utils/animate.ts +0 -69
- package/src/utils/animation-registry.ts +0 -71
- package/src/utils/base.scss +0 -14
- package/src/utils/breakpoints.ts +0 -5
- package/src/utils/card-element.ts +0 -42
- package/src/utils/components.style.scss +0 -531
- package/src/utils/defaultvalue.ts +0 -51
- package/src/utils/dropdown-element.ts +0 -244
- package/src/utils/event.ts +0 -13
- package/src/utils/form.ts +0 -183
- package/src/utils/generateId.ts +0 -4
- package/src/utils/link-element.ts +0 -34
- package/src/utils/mergeDeep.ts +0 -22
- package/src/utils/modal.ts +0 -64
- package/src/utils/object.ts +0 -2
- package/src/utils/offset.ts +0 -6
- package/src/utils/scroll.ts +0 -57
- package/src/utils/sgds-element.ts +0 -18
- package/src/utils/slot.ts +0 -102
- package/src/utils/tabbable.ts +0 -81
- package/src/utils/watch.ts +0 -62
- package/stories/ActionCard.stories.mdx +0 -199
- package/stories/Button.stories.mdx +0 -194
- package/stories/Checkbox.stories.mdx +0 -196
- package/stories/Dropdown.stories.mdx +0 -152
- package/stories/Footer.stories.mdx +0 -261
- package/stories/Input.stories.mdx +0 -236
- package/stories/MainNav.stories.mdx +0 -169
- package/stories/Masthead.stories.mdx +0 -112
- package/stories/Modal.stories.mdx +0 -103
- package/stories/QuantityToggle.stories.mdx +0 -97
- package/stories/Radio.stories.mdx +0 -262
- package/stories/Sample.stories.js +0 -29
- package/stories/Sample.stories.mdx +0 -33
- package/stories/SideNav.stories.mdx +0 -245
- package/stories/common.js +0 -185
- package/stories/textarea.stories.mdx +0 -253
- package/test/button.element.test.ts +0 -185
- package/test/checkbox.test.ts +0 -240
- package/test/dropdown.test.ts +0 -637
- package/test/footer.test.ts +0 -181
- package/test/generateId.test.ts +0 -18
- package/test/input.element.test.ts +0 -316
- package/test/link-element.test.ts +0 -38
- package/test/mainnav.test.ts +0 -313
- package/test/masthead.test.ts +0 -116
- package/test/modal.test.ts +0 -149
- package/test/quantitytoggle.test.ts +0 -76
- package/test/radio.test.ts +0 -310
- package/test/selectable-card.test.ts +0 -159
- package/test/sidenav.test.ts +0 -390
- package/test/tab.test.ts +0 -76
- package/test/textarea.test.ts +0 -126
- package/tsconfig.json +0 -26
- package/tsconfig.test.json +0 -24
- package/typings/scss.d.ts +0 -5
- package/web-dev-server.config.mjs +0 -7
- package/web-test-runner.config.mjs +0 -47
package/README.md
CHANGED
|
@@ -1,21 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="https://img.shields.io/badge/lit-324FFF?style=for-the-badge&logo=lit&logoColor=white" />
|
|
2
|
+
<img src="https://img.shields.io/badge/Sass-CC6699?style=for-the-badge&logo=sass&logoColor=white" />
|
|
3
|
+
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white" />
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# sgds-web-component
|
|
4
6
|
|
|
5
7
|
Project is still in development works. See https://master.d1yxrtldqtp3a0.amplifyapp.com/ for the progress of the components
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
# Installation Guide
|
|
10
|
+
|
|
11
|
+
You can load SGDS's web components via CDN or by installing it locally.
|
|
12
|
+
<!-- <s>If you're using a framework, make sure to check out the pages for React, Vue, and Angular for additional information.</s> -->
|
|
13
|
+
|
|
14
|
+
## CDN
|
|
15
|
+
|
|
16
|
+
The CDN loader registers all SGDS elements up front. Note that, if you're only using a handful of components. You can also cherry pick components via local imports if you want to load specific ones up front.
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
|
|
20
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component"></script>
|
|
21
|
+
|
|
22
|
+
//cherry picked
|
|
23
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component/${Component}/index.js"></script>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Local Installation
|
|
29
|
+
|
|
30
|
+
You can also install SGDS web components locally with the following command
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
|
|
34
|
+
npm install @govtechsg/sgds-web-component
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
and import the library once in your entry point
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
|
|
42
|
+
import "@govtechsg/sgds-web-component";
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Usage Guide
|
|
48
|
+
|
|
49
|
+
## Cherry Picking
|
|
50
|
+
|
|
51
|
+
We recommend cherry picking your web components whenever to limit the number of files that the browser has to load. Note that the component folder should start with capital letter
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
|
|
55
|
+
import "@govtechsg/sgds-web-component/Button";
|
|
56
|
+
//cdn way
|
|
57
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component/Button/index.js"></script>
|
|
8
58
|
|
|
9
|
-
Clone the repo. Then install.
|
|
10
59
|
|
|
11
|
-
```bash
|
|
12
|
-
npm install
|
|
13
60
|
```
|
|
14
61
|
|
|
15
|
-
|
|
62
|
+
## Component dependency
|
|
63
|
+
|
|
64
|
+
Complex components depends on one or more other components under its hood. E.g. Dropdown and Modal component uses Button component
|
|
65
|
+
For such components, you will have to import all of its dependency. The component's dependency will be specified in the Component documentation under Dependency section
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
// When using Dropdown component, import both Dropdown and Button
|
|
69
|
+
import "@govtechsg/sgds-web-component/Dropdown";
|
|
70
|
+
import "@govtechsg/sgds-web-component/Button";
|
|
16
71
|
|
|
17
|
-
```bash
|
|
18
|
-
npm run dev
|
|
19
72
|
```
|
|
20
73
|
|
|
21
|
-
|
|
74
|
+
<!-- ## Shoelace Icons
|
|
75
|
+
|
|
76
|
+
SGDS depends on 3rd party library [Shoelace](https://shoelace.style/components/icon) for our icons. We recommend using Shoelace's default icon library which are Bootstrap icons
|
|
77
|
+
|
|
78
|
+
````js
|
|
79
|
+
// data-shoelace attribute points to the assets folder, where the bootstrap icons are located. If you are copying out the assets folder to your own directory, change the value of data-shoelace to your assets folder
|
|
80
|
+
<script type="module" data-shoelace="node_modules/@shoelace-style/shoelace/dist">
|
|
81
|
+
import '@shoelace-style/shoelace/dist/components/icon/icon.js';
|
|
82
|
+
//<sl-icon> is ready to use!
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
````
|
|
86
|
+
|
|
87
|
+
You can also use the utility `setBasePath` from Shoelace to set the based path of the asset folder
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
|
|
91
|
+
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
|
|
92
|
+
// Set the base path to the folder you copied Shoelace's assets
|
|
93
|
+
setBasePath('/path/to/shoelace/dist');
|
|
94
|
+
|
|
95
|
+
import '@shoelace-style/shoelace/dist/components/icon/icon.js'
|
|
96
|
+
//<sl-icon> is ready to use!
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Please refer to [Shoelace documentation](https://shoelace.style/getting-started/installation?id=setting-the-base-path) for more information -->
|
|
101
|
+
|
|
102
|
+
## Stylings
|
|
103
|
+
|
|
104
|
+
### Component Styles
|
|
105
|
+
|
|
106
|
+
SGDS web component library is shipped with SGDS v2 stylings and does not require you to configure or install any other styling files.
|
|
107
|
+
The styles of components are built in and can be modified via props, cssparts and css custom properties whenever we specify for such styling modificiations. This information will be specified under API section for each component
|
|
108
|
+
|
|
109
|
+
You will require some knowledge of web components and css to do so and the information can be readily available online like mdn web docs for [web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) and [css](https://developer.mozilla.org/en-US/docs/Web/CSS)
|
|
110
|
+
|
|
111
|
+
### External stylings
|
|
112
|
+
|
|
113
|
+
Any external stylings done on our web components like positioning needs to be done on your end. You can use [SGDS v2 library](https://designsystem.tech.gov.sg/get-started/)to leverage on the position stylings we provide e.g. ms-auto, flexbox, grids
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import SgdsElement from "./sgds-element";
|
|
2
|
+
export type CardBorderVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "dark" | "light";
|
|
3
|
+
export type CardTextVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "dark" | "light" | "white" | "muted";
|
|
4
|
+
export declare class CardElement extends SgdsElement {
|
|
5
|
+
static styles: import("lit").CSSResultGroup;
|
|
6
|
+
borderColor?: CardBorderVariant;
|
|
7
|
+
/** The bg's variant. */
|
|
8
|
+
bgColor?: CardBorderVariant;
|
|
9
|
+
/** The text's variant. */
|
|
10
|
+
textColor?: CardTextVariant;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { Dropdown } from "bootstrap";
|
|
2
|
-
import * as Popper from "@popperjs/core";
|
|
3
|
-
import type { StrictModifiers } from "@popperjs/core";
|
|
4
|
-
import { Ref } from "lit/directives/ref.js";
|
|
5
|
-
import { SgdsDropdownItem } from "../Dropdown/sgds-dropdown-item";
|
|
6
|
-
import SgdsElement from "./sgds-element";
|
|
7
|
-
export type DropdownButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
8
|
-
export type DropDirection = "left" | "right" | "up" | "down";
|
|
9
|
-
export declare class DropdownElement extends SgdsElement {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { Dropdown } from "bootstrap";
|
|
2
|
+
import * as Popper from "@popperjs/core";
|
|
3
|
+
import type { StrictModifiers } from "@popperjs/core";
|
|
4
|
+
import { Ref } from "lit/directives/ref.js";
|
|
5
|
+
import { SgdsDropdownItem } from "../components/Dropdown/sgds-dropdown-item";
|
|
6
|
+
import SgdsElement from "./sgds-element";
|
|
7
|
+
export type DropdownButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
8
|
+
export type DropDirection = "left" | "right" | "up" | "down";
|
|
9
|
+
export declare class DropdownElement extends SgdsElement {
|
|
10
|
+
static styles: import("lit").CSSResultGroup;
|
|
11
|
+
myDropdown: Ref<HTMLElement>;
|
|
12
|
+
bsDropdown: Dropdown;
|
|
13
|
+
noFlip: boolean;
|
|
14
|
+
menuAlignRight: boolean;
|
|
15
|
+
drop: DropDirection;
|
|
16
|
+
popperOpts: {};
|
|
17
|
+
togglerId: string;
|
|
18
|
+
togglerText: string;
|
|
19
|
+
variant: DropdownButtonVariant;
|
|
20
|
+
menuIsOpen: boolean;
|
|
21
|
+
close: "outside" | "default" | "inside";
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
nextDropdownItemNo: number;
|
|
24
|
+
prevDropdownItemNo: number;
|
|
25
|
+
dropdownConfig: Partial<Popper.Options>;
|
|
26
|
+
modifierOpt: StrictModifiers[];
|
|
27
|
+
firstUpdated(): void;
|
|
28
|
+
showMenu(): void;
|
|
29
|
+
hideMenu(): void;
|
|
30
|
+
_onClickButton(): void;
|
|
31
|
+
_resetMenu(): void;
|
|
32
|
+
_getMenuItems(): SgdsDropdownItem[];
|
|
33
|
+
_getActiveMenuItems(): SgdsDropdownItem[];
|
|
34
|
+
_setMenuItem(currentItemIdx: number, isArrowDown?: boolean): any;
|
|
35
|
+
_handleSelectSlot(e: KeyboardEvent | MouseEvent): void;
|
|
36
|
+
_handleKeyboardEvent(e: KeyboardEvent): any;
|
|
37
|
+
_handleClickOutOfElement(e: MouseEvent, self: DropdownElement): void;
|
|
38
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import SgdsElement from "
|
|
2
|
-
export default class LinkElement extends SgdsElement {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import SgdsElement from "./sgds-element";
|
|
2
|
+
export default class LinkElement extends SgdsElement {
|
|
3
|
+
static styles: import("lit").CSSResultGroup;
|
|
4
|
+
active: boolean;
|
|
5
|
+
href: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement } from
|
|
2
|
-
export default class SgdsElement extends LitElement {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export default class SgdsElement extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResultGroup;
|
|
4
|
+
/** Emits a custom event with more convenient defaults. */
|
|
5
|
+
emit(name: string, options?: CustomEventInit): CustomEvent<any>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
/**
|
|
3
|
+
* @slot default - content of the accordion item
|
|
4
|
+
*
|
|
5
|
+
* @event sgds-show - Emitted on show.
|
|
6
|
+
* @event sgds-after-show - Emitted on show after animation has completed.
|
|
7
|
+
* @event sgds-hide - Emitted on hide.
|
|
8
|
+
* @event sgds-after-hide - Emitted on hide after animation has completed.
|
|
9
|
+
*
|
|
10
|
+
* @csspart base - The accordion-item base wrapper
|
|
11
|
+
* @csspart header - The accordion-item button header
|
|
12
|
+
* @csspart content - The accordion-item content
|
|
13
|
+
*/
|
|
14
|
+
export declare class SgdsAccordionItem extends SgdsElement {
|
|
15
|
+
static styles: import("lit").CSSResultGroup[];
|
|
16
|
+
/** @internal */
|
|
17
|
+
accordion: HTMLElement;
|
|
18
|
+
/** @internal */
|
|
19
|
+
header: HTMLElement;
|
|
20
|
+
/** @internal */
|
|
21
|
+
body: HTMLElement;
|
|
22
|
+
/** Controls whether accordion-item is open or close */
|
|
23
|
+
open: boolean;
|
|
24
|
+
/** Title of the accordion */
|
|
25
|
+
summary: string;
|
|
26
|
+
/** Disables the accordion-item. When true, accordion-item cannot open */
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/** Optional for accordion item. Can be used to insert any utility classes such as `me-auto` */
|
|
29
|
+
accordionItemClasses?: string;
|
|
30
|
+
firstUpdated(): void;
|
|
31
|
+
private handleSummaryClick;
|
|
32
|
+
private handleSummaryKeyDown;
|
|
33
|
+
handleOpenChange(): Promise<void>;
|
|
34
|
+
/** Shows the accordion. */
|
|
35
|
+
show(): Promise<void>;
|
|
36
|
+
/** Hide the accordion */
|
|
37
|
+
hide(): Promise<void>;
|
|
38
|
+
render(): import("lit").TemplateResult<1>;
|
|
39
|
+
}
|
|
40
|
+
export default SgdsAccordionItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
import type SgdsAccordionItem from "./sgds-accordion-item";
|
|
3
|
+
/**
|
|
4
|
+
* @summary A dropdown mechanism that allow users to either show or hide related content.
|
|
5
|
+
* @slot default - slot for accordion-item
|
|
6
|
+
*/
|
|
7
|
+
export declare class SgdsAccordion extends SgdsElement {
|
|
8
|
+
static styles: import("lit").CSSResultGroup[];
|
|
9
|
+
allowMultiple: boolean;
|
|
10
|
+
accordionClasses?: string;
|
|
11
|
+
/** @internal */
|
|
12
|
+
private defaultNodes;
|
|
13
|
+
/** @internal */
|
|
14
|
+
get items(): SgdsAccordionItem[];
|
|
15
|
+
firstUpdated(): void;
|
|
16
|
+
onToggle(event: Event): Promise<void>;
|
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
export default SgdsAccordion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sgds-action-card";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type CardVariant = "card-action" | "card-action-quantity-toggle";
|
|
4
|
-
export type TypeVariant = "checkbox" | "radio";
|
|
5
|
-
export declare class SgdsActionCard extends CardElement {
|
|
6
|
-
static styles: import("lit").CSSResultGroup;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
iconName
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { Ref } from "lit/directives/ref.js";
|
|
2
|
+
import { CardElement } from "../../base/card-element";
|
|
3
|
+
export type CardVariant = "card-action" | "card-action-quantity-toggle";
|
|
4
|
+
export type TypeVariant = "checkbox" | "radio";
|
|
5
|
+
export declare class SgdsActionCard extends CardElement {
|
|
6
|
+
static styles: import("lit").CSSResultGroup[];
|
|
7
|
+
/** @internal */
|
|
8
|
+
inputRef: Ref<HTMLInputElement>;
|
|
9
|
+
type?: TypeVariant;
|
|
10
|
+
/** Use on actionable cards like SelectableCard and Quantity Toggle Card' */
|
|
11
|
+
variant: CardVariant;
|
|
12
|
+
/** The card's subtitle iconName. */
|
|
13
|
+
iconName?: string;
|
|
14
|
+
/** The input's id. */
|
|
15
|
+
inputId?: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
onInputChange(): void;
|
|
18
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
19
|
+
render(): import("lit").TemplateResult;
|
|
20
|
+
}
|
|
21
|
+
export default SgdsActionCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sgds-alert";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @dependency sl-icon-button
|
|
5
|
+
*
|
|
6
|
+
* @slot - The alert's main content.
|
|
7
|
+
* @slot icon - An icon to show in the alert. Works best with `<sl-icon>`.
|
|
8
|
+
*
|
|
9
|
+
* @event sl-show - Emitted when the alert opens.
|
|
10
|
+
* @event sl-after-show - Emitted after the alert opens and all animations are complete.
|
|
11
|
+
* @event sl-hide - Emitted when the alert closes.
|
|
12
|
+
* @event sl-after-hide - Emitted after the alert closes and all animations are complete.
|
|
13
|
+
*
|
|
14
|
+
* @csspart base - The component's base wrapper.
|
|
15
|
+
* @csspart icon - The container that wraps the optional icon.
|
|
16
|
+
* @csspart message - The container that wraps the alert's main content.
|
|
17
|
+
* @csspart close-button - The close button, an `<sl-icon-button>`.
|
|
18
|
+
* @csspart close-button__base - The close button's exported `base` part.
|
|
19
|
+
*
|
|
20
|
+
* @animation alert.show - The animation to use when showing the alert.
|
|
21
|
+
* @animation alert.hide - The animation to use when hiding the alert.
|
|
22
|
+
*/
|
|
23
|
+
export type AlertVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light";
|
|
24
|
+
export declare class SgdsAlert extends SgdsElement {
|
|
25
|
+
static styles: import("lit").CSSResultGroup[];
|
|
26
|
+
show: boolean;
|
|
27
|
+
/** Enables a close button that allows the user to dismiss the alert. */
|
|
28
|
+
dismissible?: boolean;
|
|
29
|
+
/** The alert's theme variant. */
|
|
30
|
+
variant: AlertVariant;
|
|
31
|
+
closeLabel?: string;
|
|
32
|
+
alertClasses?: string;
|
|
33
|
+
toggleShow(): void;
|
|
34
|
+
handleCloseClick(): void;
|
|
35
|
+
render(): import("lit").TemplateResult;
|
|
36
|
+
}
|
|
37
|
+
export default SgdsAlert;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SgdsBadge } from "./sgds-badge";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export type BadgeVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
3
|
+
export declare class SgdsBadge extends SgdsElement {
|
|
4
|
+
static styles: import("lit").CSSResultGroup[];
|
|
5
|
+
variant: BadgeVariant;
|
|
6
|
+
isLight: any;
|
|
7
|
+
roundedPill: any;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
export default SgdsBadge;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export declare class SgdsBreadcrumbItem extends SgdsElement {
|
|
3
|
+
static styles: import("lit").CSSResultGroup[];
|
|
4
|
+
currentPage: any;
|
|
5
|
+
href: any;
|
|
6
|
+
target?: "_blank" | "_parent" | "_self" | "_top";
|
|
7
|
+
rel: string;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
export default SgdsBreadcrumbItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export declare class SgdsBreadcrumb extends SgdsElement {
|
|
3
|
+
static styles: import("lit").CSSResultGroup[];
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
breadcrumbClasses?: string;
|
|
6
|
+
defaultSlot: HTMLSlotElement;
|
|
7
|
+
separatorSlot: HTMLSlotElement;
|
|
8
|
+
private getSeparator;
|
|
9
|
+
private handleSlotChange;
|
|
10
|
+
render(): import("lit").TemplateResult;
|
|
11
|
+
}
|
|
12
|
+
export default SgdsBreadcrumb;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sgds-button";
|
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
import SgdsElement from "
|
|
2
|
-
export type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link" | "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/** Used to override the form owner's `
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-danger" | "outline-warning" | "outline-info" | "outline-light" | "outline-dark";
|
|
3
|
+
/**
|
|
4
|
+
* @slot - The button's label.
|
|
5
|
+
*
|
|
6
|
+
* @event sgds-blur - Emitted when the button is not focused.
|
|
7
|
+
* @event sgds-focus - Emitted when the button is focused.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SgdsButton extends SgdsElement {
|
|
10
|
+
static styles: import("lit").CSSResultGroup[];
|
|
11
|
+
button: HTMLButtonElement | HTMLLinkElement;
|
|
12
|
+
private readonly formSubmitController;
|
|
13
|
+
private hasFocus;
|
|
14
|
+
/** The button's variant. */
|
|
15
|
+
variant: ButtonVariant;
|
|
16
|
+
buttonClasses?: string;
|
|
17
|
+
/** Button sizes */
|
|
18
|
+
size: "sm" | "lg";
|
|
19
|
+
/** Button active state */
|
|
20
|
+
active: boolean;
|
|
21
|
+
/** Button disabled state */
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
type: "button" | "submit" | "reset";
|
|
24
|
+
/** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */
|
|
25
|
+
href?: string;
|
|
26
|
+
/** Tells the browser where to open the link. Only used when `href` is set. */
|
|
27
|
+
target?: "_blank" | "_parent" | "_self" | "_top";
|
|
28
|
+
/** Tells the browser to download the linked file as this filename. Only used when `href` is set. */
|
|
29
|
+
download?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The
|
|
32
|
+
* value of this attribute must be an id of a form in the same document or shadow root as the button.
|
|
33
|
+
*/
|
|
34
|
+
form: string;
|
|
35
|
+
/** Used to override the form owner's `action` attribute. */
|
|
36
|
+
formAction: string;
|
|
37
|
+
/** Used to override the form owner's `method` attribute. */
|
|
38
|
+
formMethod: "post" | "get";
|
|
39
|
+
/** Used to override the form owner's `novalidate` attribute. */
|
|
40
|
+
formNoValidate: boolean;
|
|
41
|
+
/** Used to override the form owner's `target` attribute. */
|
|
42
|
+
formTarget: "_self" | "_blank" | "_parent" | "_top" | string;
|
|
43
|
+
/** Sets focus on the button. */
|
|
44
|
+
focus(options?: FocusOptions): void;
|
|
45
|
+
/** Simulates a click on the button. */
|
|
46
|
+
click(): void;
|
|
47
|
+
/** Removes focus from the button. */
|
|
48
|
+
blur(): void;
|
|
49
|
+
handleBlur(): void;
|
|
50
|
+
handleFocus(): void;
|
|
51
|
+
handleClick(event: MouseEvent): void;
|
|
52
|
+
clickHandler: () => void;
|
|
53
|
+
render(): import("lit").TemplateResult;
|
|
54
|
+
}
|
|
55
|
+
export default SgdsButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sgds-checkbox";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import SgdsElement from "
|
|
2
|
-
export declare class SgdsCheckbox extends SgdsElement {
|
|
3
|
-
static styles: import("lit").CSSResultGroup;
|
|
4
|
-
input: HTMLInputElement;
|
|
5
|
-
private readonly formSubmitController;
|
|
6
|
-
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** For Id/For pair of the HTML form control. */
|
|
9
|
-
checkboxId: string;
|
|
10
|
-
/** For aria-label when there is no appropriate text label visible */
|
|
11
|
-
ariaLabel: string;
|
|
12
|
-
/** Manually style the input as valid */
|
|
13
|
-
valid: boolean;
|
|
14
|
-
/** Manually style the input as invalid */
|
|
15
|
-
invalid: boolean;
|
|
16
|
-
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
17
|
-
value: string;
|
|
18
|
-
/** Makes the checkbox a required field. */
|
|
19
|
-
required: boolean;
|
|
20
|
-
/** Draws the checkbox in a checked state. */
|
|
21
|
-
checked: boolean;
|
|
22
|
-
/** Disables the checkbox (so the user can't check / uncheck it). */
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
/** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
|
|
25
|
-
defaultChecked: boolean;
|
|
26
|
-
/** Simulates a click on the checkbox. */
|
|
27
|
-
click(): void;
|
|
28
|
-
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
29
|
-
reportValidity(): boolean;
|
|
30
|
-
handleChange(): void;
|
|
31
|
-
handleKeyDown(event: KeyboardEvent): void;
|
|
32
|
-
handleDisabledChange(): void;
|
|
33
|
-
handleStateChange(): void;
|
|
34
|
-
render(): import("lit").TemplateResult<1>;
|
|
35
|
-
}
|
|
36
|
-
export default SgdsCheckbox;
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export declare class SgdsCheckbox extends SgdsElement {
|
|
3
|
+
static styles: import("lit").CSSResultGroup[];
|
|
4
|
+
input: HTMLInputElement;
|
|
5
|
+
private readonly formSubmitController;
|
|
6
|
+
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** For Id/For pair of the HTML form control. */
|
|
9
|
+
checkboxId: string;
|
|
10
|
+
/** For aria-label when there is no appropriate text label visible */
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
/** Manually style the input as valid */
|
|
13
|
+
valid: boolean;
|
|
14
|
+
/** Manually style the input as invalid */
|
|
15
|
+
invalid: boolean;
|
|
16
|
+
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
17
|
+
value: string;
|
|
18
|
+
/** Makes the checkbox a required field. */
|
|
19
|
+
required: boolean;
|
|
20
|
+
/** Draws the checkbox in a checked state. */
|
|
21
|
+
checked: boolean;
|
|
22
|
+
/** Disables the checkbox (so the user can't check / uncheck it). */
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
|
|
25
|
+
defaultChecked: boolean;
|
|
26
|
+
/** Simulates a click on the checkbox. */
|
|
27
|
+
click(): void;
|
|
28
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
29
|
+
reportValidity(): boolean;
|
|
30
|
+
handleChange(): void;
|
|
31
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
32
|
+
handleDisabledChange(): void;
|
|
33
|
+
handleStateChange(): void;
|
|
34
|
+
render(): import("lit").TemplateResult<1>;
|
|
35
|
+
}
|
|
36
|
+
export default SgdsCheckbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SgdsCloseButton } from "./sgds-closebutton";
|