├── .DS_Store ├── .babelrc ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── publish-latest.yml │ ├── publish-pr.yml │ └── sync-to-gist.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── prepare-commit-msg ├── .nvmrc ├── .storybook ├── global.css ├── main.js ├── manager-head.html ├── manager.js ├── preview-head.html ├── preview.ts ├── sgdsTheme.js ├── static │ ├── good-seo.svg │ ├── logo.png │ └── poor-seo.svg └── storybookVite.config.js ├── .vscode └── settings.json ├── CHANGELOG.md ├── CODE_CONVENTIONS.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── amplify.yml ├── commitlint.config.js ├── coverage ├── lcov-report │ ├── base.css │ ├── block-navigation.js │ ├── button-element.scss.html │ ├── button-element.ts.html │ ├── favicon.png │ ├── index.html │ ├── prettify.css │ ├── prettify.js │ ├── sort-arrow-sprite.png │ └── sorter.js └── lcov.info ├── custom-elements-manifest.config.mjs ├── cypress.config.ts ├── cypress ├── .DS_Store ├── apps │ ├── angular-app │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── README.md │ │ ├── angular.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.module.ts │ │ │ │ └── app.routes.ts │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── components │ │ │ │ ├── accordion │ │ │ │ │ ├── accordion.component.html │ │ │ │ │ └── accordion.component.ts │ │ │ │ ├── alert │ │ │ │ │ ├── alert.component.html │ │ │ │ │ └── alert.component.ts │ │ │ │ ├── badge │ │ │ │ │ ├── badge.component.html │ │ │ │ │ └── badge.component.ts │ │ │ │ ├── breadcrumb │ │ │ │ │ ├── breadcrumb.component.html │ │ │ │ │ └── breadcrumb.component.ts │ │ │ │ ├── button │ │ │ │ │ ├── button.component.html │ │ │ │ │ └── button.component.ts │ │ │ │ ├── card │ │ │ │ │ ├── card.component.html │ │ │ │ │ └── card.component.ts │ │ │ │ ├── checkbox │ │ │ │ │ ├── checkbox.component.html │ │ │ │ │ └── checkbox.component.ts │ │ │ │ ├── combobox │ │ │ │ │ ├── combobox.component.html │ │ │ │ │ └── combobox.component.ts │ │ │ │ ├── datepicker │ │ │ │ │ ├── datepicker.component.html │ │ │ │ │ └── datepicker.component.ts │ │ │ │ ├── descriptionlist │ │ │ │ │ ├── descriptionlist.component.html │ │ │ │ │ └── descriptionlist.component.ts │ │ │ │ ├── divider │ │ │ │ │ ├── divider.component.html │ │ │ │ │ └── divider.component.ts │ │ │ │ ├── drawer │ │ │ │ │ ├── drawer.component.html │ │ │ │ │ └── drawer.component.ts │ │ │ │ ├── dropdown │ │ │ │ │ ├── dropdown.component.html │ │ │ │ │ └── dropdown.component.ts │ │ │ │ ├── fileupload │ │ │ │ │ ├── fileupload.component.html │ │ │ │ │ └── fileupload.component.ts │ │ │ │ ├── footer │ │ │ │ │ ├── footer.component.html │ │ │ │ │ └── footer.component.ts │ │ │ │ ├── icon │ │ │ │ │ ├── icon.component.html │ │ │ │ │ └── icon.component.ts │ │ │ │ ├── iconbutton │ │ │ │ │ ├── iconbutton.component.html │ │ │ │ │ └── iconbutton.component.ts │ │ │ │ ├── iconlist │ │ │ │ │ ├── iconlist.component.html │ │ │ │ │ └── iconlist.component.ts │ │ │ │ ├── input │ │ │ │ │ ├── input.component.html │ │ │ │ │ └── input.component.ts │ │ │ │ ├── link │ │ │ │ │ ├── link.component.html │ │ │ │ │ └── link.component.ts │ │ │ │ ├── mainnav │ │ │ │ │ ├── mainnav.component.html │ │ │ │ │ └── mainnav.component.ts │ │ │ │ ├── masthead │ │ │ │ │ ├── masthead.component.html │ │ │ │ │ └── masthead.component.ts │ │ │ │ ├── modal │ │ │ │ │ ├── modal.component.html │ │ │ │ │ └── modal.component.ts │ │ │ │ ├── pagination │ │ │ │ │ ├── pagination.component.html │ │ │ │ │ └── pagination.component.ts │ │ │ │ ├── progressbar │ │ │ │ │ ├── progressbar.component.html │ │ │ │ │ └── progressbar.component.ts │ │ │ │ ├── quantitytoggle │ │ │ │ │ ├── quantitytoggle.component.html │ │ │ │ │ └── quantitytoggle.component.ts │ │ │ │ ├── radio │ │ │ │ │ ├── radio.component.html │ │ │ │ │ └── radio.component.ts │ │ │ │ ├── sidenav │ │ │ │ │ ├── sidenav.component.html │ │ │ │ │ └── sidenav.component.ts │ │ │ │ ├── skeleton │ │ │ │ │ ├── skeleton.component.html │ │ │ │ │ └── skeleton.component.ts │ │ │ │ ├── spinner │ │ │ │ │ ├── spinner.component.html │ │ │ │ │ └── spinner.component.ts │ │ │ │ ├── stepper │ │ │ │ │ ├── stepper.component.html │ │ │ │ │ └── stepper.component.ts │ │ │ │ ├── switch │ │ │ │ │ ├── switch.component.html │ │ │ │ │ └── switch.component.ts │ │ │ │ ├── tab │ │ │ │ │ ├── tab.component.html │ │ │ │ │ └── tab.component.ts │ │ │ │ ├── table │ │ │ │ │ ├── table.component.html │ │ │ │ │ └── table.component.ts │ │ │ │ ├── tableofcontents │ │ │ │ │ ├── tableofcontents.component.html │ │ │ │ │ └── tableofcontents.component.ts │ │ │ │ ├── textarea │ │ │ │ │ ├── textarea.component.html │ │ │ │ │ └── textarea.component.ts │ │ │ │ ├── toast │ │ │ │ │ ├── toast.component.html │ │ │ │ │ └── toast.component.ts │ │ │ │ └── tooltip │ │ │ │ │ ├── tooltip.component.html │ │ │ │ │ └── tooltip.component.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json │ ├── next-app │ │ ├── .eslintrc.json │ │ ├── .gitignore │ │ ├── README.md │ │ ├── next.config.mjs │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ ├── next.svg │ │ │ └── vercel.svg │ │ ├── src │ │ │ └── app │ │ │ │ ├── components │ │ │ │ ├── Accordion.tsx │ │ │ │ ├── Alert.tsx │ │ │ │ ├── Badge.tsx │ │ │ │ ├── Breadcrumb.tsx │ │ │ │ ├── Button.tsx │ │ │ │ ├── Card.tsx │ │ │ │ ├── Checkbox.tsx │ │ │ │ ├── Combobox.tsx │ │ │ │ ├── Datepicker.tsx │ │ │ │ ├── DescriptionList.tsx │ │ │ │ ├── Divider.tsx │ │ │ │ ├── Drawer.tsx │ │ │ │ ├── Dropdown.tsx │ │ │ │ ├── FileUpload.tsx │ │ │ │ ├── Footer.tsx │ │ │ │ ├── Icon.tsx │ │ │ │ ├── IconButton.tsx │ │ │ │ ├── IconList.tsx │ │ │ │ ├── Input.tsx │ │ │ │ ├── Link.tsx │ │ │ │ ├── Mainnav.tsx │ │ │ │ ├── Masthead.tsx │ │ │ │ ├── Modal.tsx │ │ │ │ ├── Pagination.tsx │ │ │ │ ├── ProgressBar.tsx │ │ │ │ ├── QuantityToggle.tsx │ │ │ │ ├── Radio.tsx │ │ │ │ ├── Sidenav.tsx │ │ │ │ ├── Skeleton.jsx │ │ │ │ ├── Spinner.tsx │ │ │ │ ├── Stepper.tsx │ │ │ │ ├── Switch.tsx │ │ │ │ ├── Tab.tsx │ │ │ │ ├── Table.tsx │ │ │ │ ├── TableOfContents.tsx │ │ │ │ ├── Textarea.tsx │ │ │ │ ├── Toast.tsx │ │ │ │ └── Tooltip.tsx │ │ │ │ ├── favicon.ico │ │ │ │ ├── globals.css │ │ │ │ ├── layout.tsx │ │ │ │ ├── page.module.css │ │ │ │ └── page.tsx │ │ ├── tsconfig.json │ │ └── types.d.ts │ ├── react-app │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── index.html │ │ └── src │ │ │ ├── App.js │ │ │ ├── components │ │ │ ├── Accordion.jsx │ │ │ ├── Alert.jsx │ │ │ ├── Badge.jsx │ │ │ ├── Breadcrumb.jsx │ │ │ ├── Button.jsx │ │ │ ├── Card.jsx │ │ │ ├── Combobox.jsx │ │ │ ├── Datepicker.jsx │ │ │ ├── Divider.jsx │ │ │ ├── Drawer.jsx │ │ │ ├── Dropdown.jsx │ │ │ ├── FileUpload.jsx │ │ │ ├── Footer.jsx │ │ │ ├── IconButton.jsx │ │ │ ├── Input.jsx │ │ │ ├── Mainnav.jsx │ │ │ ├── Masthead.jsx │ │ │ ├── Modal.jsx │ │ │ ├── Pagination.jsx │ │ │ ├── ProgressBar.jsx │ │ │ ├── QuantityToggle.jsx │ │ │ ├── Radio.jsx │ │ │ ├── Sidenav.jsx │ │ │ ├── Skeleton.jsx │ │ │ ├── Spinner.jsx │ │ │ ├── Stepper.jsx │ │ │ ├── Tab.jsx │ │ │ ├── Table.jsx │ │ │ ├── Textarea.jsx │ │ │ ├── Toast.jsx │ │ │ └── Tooltip.jsx │ │ │ ├── index.css │ │ │ ├── index.js │ │ │ ├── reportWebVitals.js │ │ │ └── setupTests.js │ └── vue-app │ │ ├── .gitignore │ │ ├── .vscode │ │ └── extensions.json │ │ ├── README.md │ │ ├── env.d.ts │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── App.vue │ │ ├── components │ │ │ ├── Accordion.vue │ │ │ ├── Alert.vue │ │ │ ├── Badge.vue │ │ │ ├── Breadcrumb.vue │ │ │ ├── Button.vue │ │ │ ├── Card.vue │ │ │ ├── Checkbox.vue │ │ │ ├── Combobox.vue │ │ │ ├── Datepicker.vue │ │ │ ├── DescriptionList.vue │ │ │ ├── Divider.vue │ │ │ ├── Drawer.vue │ │ │ ├── Dropdown.vue │ │ │ ├── FileUpload.vue │ │ │ ├── Footer.vue │ │ │ ├── Icon.vue │ │ │ ├── IconButton.vue │ │ │ ├── IconList.vue │ │ │ ├── Input.vue │ │ │ ├── Link.vue │ │ │ ├── Mainnav.vue │ │ │ ├── Masthead.vue │ │ │ ├── Modal.vue │ │ │ ├── Pagination.vue │ │ │ ├── ProgressBar.vue │ │ │ ├── QuantityToggle.vue │ │ │ ├── Radio.vue │ │ │ ├── Sidenav.vue │ │ │ ├── Skeleton.vue │ │ │ ├── Spinner.vue │ │ │ ├── Stepper.vue │ │ │ ├── Switch.vue │ │ │ ├── Tab.vue │ │ │ ├── Table.vue │ │ │ ├── TableOfContents.vue │ │ │ ├── Textarea.vue │ │ │ ├── Toast.vue │ │ │ └── Trigger.vue │ │ └── main.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts ├── e2e │ ├── angular.spec.cy.ts │ ├── next.spec.cy.ts │ ├── react.spec.cy.ts │ └── vue.spec.cy.ts ├── scripts │ ├── run_all.js │ ├── run_angular.sh │ ├── run_next.sh │ ├── run_react.sh │ └── run_vue.sh ├── support │ ├── commands.ts │ ├── e2e.ts │ └── index.ts └── tsconfig.json ├── docs ├── Angular.md ├── Attributes.md ├── Events.md ├── Extendable.md ├── FAQ.md ├── FoundationalStyles.md ├── Grid.md ├── HEADER.md ├── INSTALLATION.md ├── Imports.md ├── Introduction.md ├── Migration_v1_to_v2.md ├── Migration_v2_to_v3.md ├── Next.md ├── React.md ├── ScopedElements.md ├── Slots.md ├── Status.md ├── Theming.md ├── Vue.md ├── WebComponents.md └── templates │ └── INSTALLATION.md ├── gulpfile.babel.js ├── index.html ├── mocks ├── dropdown.d.ts ├── dropdown.ts ├── link.d.ts ├── link.ts ├── pagination.ts └── stepper.ts ├── package-lock.json ├── package.json ├── plop-templates ├── basic.hbs ├── component.hbs ├── index.hbs └── test.hbs ├── plopfile.mjs ├── prettier.config.js ├── rollup.config.mjs ├── rollup.test.config.js ├── scripts ├── __tests__ │ ├── makeArgTypes.test.js │ ├── methodsTable.test.js │ ├── resolveTypeAliasPlugin.test.js │ └── shared.test.js ├── buildUtils.js ├── frankBuild.js ├── generateStories.mjs ├── makeArgTypes.mjs ├── makeReact.mjs ├── methodsTable.mjs ├── resolveTypeAliasPlugin.mjs └── shared.mjs ├── sgds-design-alpha-testing.zip ├── src ├── .DS_Store ├── base │ ├── button-element.ts │ ├── button.css │ ├── card-element.ts │ ├── card.css │ ├── dropdown-element.ts │ ├── dropdown-list-element.ts │ ├── form-control-element.ts │ ├── link-element.ts │ ├── sgds-element.css │ └── sgds-element.ts ├── components │ ├── .DS_Store │ ├── Accordion │ │ ├── accordion-item.css │ │ ├── accordion.css │ │ ├── index.ts │ │ ├── sgds-accordion-item.ts │ │ └── sgds-accordion.ts │ ├── Alert │ │ ├── alert-link.css │ │ ├── alert.css │ │ ├── index.ts │ │ ├── sgds-alert-link.ts │ │ └── sgds-alert.ts │ ├── Badge │ │ ├── badge.css │ │ ├── index.ts │ │ └── sgds-badge.ts │ ├── Breadcrumb │ │ ├── breadcrumb-item.css │ │ ├── breadcrumb.css │ │ ├── index.ts │ │ ├── sgds-breadcrumb-item.ts │ │ └── sgds-breadcrumb.ts │ ├── Button │ │ ├── button.css │ │ ├── index.ts │ │ └── sgds-button.ts │ ├── Card │ │ ├── card.css │ │ ├── index.ts │ │ └── sgds-card.ts │ ├── Checkbox │ │ ├── checkbox-group.css │ │ ├── checkbox.css │ │ ├── index.ts │ │ ├── sgds-checkbox-group.ts │ │ └── sgds-checkbox.ts │ ├── ComboBox │ │ ├── combo-box-item.css │ │ ├── combo-box-item.ts │ │ ├── combo-box.css │ │ ├── index.ts │ │ └── sgds-combo-box.ts │ ├── Datepicker │ │ ├── datepicker-calendar.css │ │ ├── datepicker-calendar.ts │ │ ├── datepicker-header.css │ │ ├── datepicker-header.ts │ │ ├── datepicker-input.css │ │ ├── datepicker-input.ts │ │ ├── datepicker.css │ │ ├── index.ts │ │ ├── sgds-datepicker.ts │ │ └── types.ts │ ├── DescriptionList │ │ ├── description-list-group.css │ │ ├── description-list.css │ │ ├── index.ts │ │ ├── sgds-description-list-group.ts │ │ └── sgds-description-list.ts │ ├── Divider │ │ ├── divider.css │ │ ├── index.ts │ │ └── sgds-divider.ts │ ├── Drawer │ │ ├── drawer.css │ │ ├── index.ts │ │ └── sgds-drawer.ts │ ├── Dropdown │ │ ├── dropdown-item.css │ │ ├── dropdown-menu.css │ │ ├── dropdown.css │ │ ├── index.ts │ │ ├── sgds-dropdown-item.ts │ │ └── sgds-dropdown.ts │ ├── FileUpload │ │ ├── file-upload.css │ │ ├── index.ts │ │ └── sgds-file-upload.ts │ ├── Footer │ │ ├── footer-item.css │ │ ├── footer.css │ │ ├── index.ts │ │ ├── sgds-footer-item.ts │ │ └── sgds-footer.ts │ ├── Icon │ │ ├── icon-registry.ts │ │ ├── icon.css │ │ ├── index.ts │ │ └── sgds-icon.ts │ ├── IconButton │ │ ├── icon-button.css │ │ ├── index.ts │ │ └── sgds-icon-button.ts │ ├── IconList │ │ ├── icon-list.css │ │ ├── index.ts │ │ └── sgds-icon-list.ts │ ├── Input │ │ ├── index.ts │ │ ├── input.css │ │ └── sgds-input.ts │ ├── Link │ │ ├── index.ts │ │ ├── link.css │ │ └── sgds-link.ts │ ├── Mainnav │ │ ├── index.ts │ │ ├── mainnav-context.ts │ │ ├── mainnav-dropdown.css │ │ ├── mainnav-item.css │ │ ├── mainnav.css │ │ ├── sgds-mainnav-dropdown.ts │ │ ├── sgds-mainnav-item.ts │ │ └── sgds-mainnav.ts │ ├── Masthead │ │ ├── index.ts │ │ ├── masthead.css │ │ └── sgds-masthead.ts │ ├── Modal │ │ ├── index.ts │ │ ├── modal.css │ │ └── sgds-modal.ts │ ├── Pagination │ │ ├── index.ts │ │ ├── pagination.css │ │ └── sgds-pagination.ts │ ├── ProgressBar │ │ ├── index.ts │ │ ├── progress-bar.css │ │ └── sgds-progress-bar.ts │ ├── QuantityToggle │ │ ├── index.ts │ │ ├── quantity-toggle.css │ │ └── sgds-quantity-toggle.ts │ ├── Radio │ │ ├── index.ts │ │ ├── radio-group.css │ │ ├── radio.css │ │ ├── sgds-radio-group.ts │ │ └── sgds-radio.ts │ ├── Sidenav │ │ ├── index.ts │ │ ├── sgds-sidenav-item.ts │ │ ├── sgds-sidenav-link.ts │ │ ├── sgds-sidenav.ts │ │ ├── sidenav-item.css │ │ ├── sidenav-link.css │ │ └── sidenav.css │ ├── Skeleton │ │ ├── index.ts │ │ ├── sgds-skeleton.ts │ │ └── skeleton.css │ ├── Spinner │ │ ├── index.ts │ │ ├── sgds-spinner.ts │ │ └── spinner.css │ ├── Stepper │ │ ├── index.ts │ │ ├── sgds-stepper.ts │ │ └── stepper.css │ ├── Switch │ │ ├── index.ts │ │ ├── sgds-switch.ts │ │ └── switch.css │ ├── Tab │ │ ├── index.ts │ │ ├── sgds-tab-group.ts │ │ ├── sgds-tab-panel.ts │ │ ├── sgds-tab.ts │ │ ├── tab-group.css │ │ ├── tab-panel.css │ │ └── tab.css │ ├── Table │ │ ├── index.ts │ │ ├── sgds-table.ts │ │ └── table.css │ ├── TableOfContents │ │ ├── index.ts │ │ ├── sgds-table-of-contents.ts │ │ └── table-of-contents.css │ ├── Textarea │ │ ├── index.ts │ │ ├── sgds-textarea.ts │ │ └── textarea.css │ ├── Toast │ │ ├── index.ts │ │ ├── sgds-toast-container.ts │ │ ├── sgds-toast.ts │ │ ├── toast-container.css │ │ └── toast.css │ ├── Tooltip │ │ ├── index.ts │ │ ├── sgds-tooltip.ts │ │ └── tooltip.css │ └── index.ts ├── css │ ├── grid.css │ ├── reboot.css │ └── sgds.css ├── index.ts ├── internals │ ├── CloseButton │ │ ├── close-button.css │ │ ├── index.ts │ │ └── sgds-close-button.ts │ └── OverflowMenu │ │ ├── index.ts │ │ ├── overflow-menu.css │ │ └── sgds-overflow-menu.ts ├── styles │ ├── anchor.css │ ├── bg-variants.css │ ├── border-variants.css │ ├── feedback.css │ ├── form-check.css │ ├── form-hint.css │ ├── form-label.css │ ├── form-placeholder.css │ ├── header-class.css │ ├── order.css │ ├── paragraph.css │ ├── reboot.css │ ├── svg.css │ └── text-variants.css ├── themes │ ├── day.css │ ├── night.css │ └── root.css ├── typings │ └── index.d.ts └── utils │ ├── animate.ts │ ├── animation-registry.ts │ ├── breakpoints.ts │ ├── ce-registry.ts │ ├── defaultvalue.ts │ ├── event.ts │ ├── formSubmitController.ts │ ├── generateCustomElementName.ts │ ├── generateId.ts │ ├── inputValidationController.ts │ ├── mergeDeep.ts │ ├── modal.ts │ ├── object.ts │ ├── offset.ts │ ├── scroll.ts │ ├── slot.ts │ ├── tabbable.ts │ ├── test.ts │ ├── time.ts │ ├── validatorMixin.ts │ └── watch.ts ├── stories ├── README.md ├── form-validation │ ├── validation.mdx │ └── validation.stories.js ├── frameworks │ ├── Angular.mdx │ ├── Next.mdx │ ├── React.mdx │ └── Vue.mdx ├── getting-started │ ├── About.mdx │ ├── Imports.mdx │ ├── Installation.mdx │ └── Introduction.mdx ├── migration │ ├── oneToTwo.mdx │ └── twoToThree.mdx ├── patterns.mdx ├── style │ ├── FoundationStyle.mdx │ ├── GridSystem.mdx │ ├── Theming.mdx │ ├── foundation.stories.js │ └── grid.stories.js ├── templates.mdx ├── templates │ ├── Accordion │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Alert │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Badge │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Breadcrumb │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Button │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Card │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Checkbox │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── ComboBox │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Datepicker │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── DescriptionList │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Divider │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Drawer │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Dropdown │ │ └── basic.js │ ├── FileUpload │ │ └── basic.js │ ├── Footer │ │ └── basic.js │ ├── Icon │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── IconButton │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── IconList │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Input │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Link │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Mainnav │ │ └── basic.js │ ├── Masthead │ │ └── basic.js │ ├── Modal │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Pagination │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── ProgressBar │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── QuantityToggle │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Radio │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Sidenav │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Skeleton │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Spinner │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Stepper │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Switch │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Tab │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Table │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── TableOfContents │ │ ├── additional.mdx │ │ └── basic.js │ ├── Textarea │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ ├── Toast │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js │ └── Tooltip │ │ ├── additional.mdx │ │ ├── additional.stories.js │ │ └── basic.js ├── troubleshooting.mdx └── usage │ ├── Attributes.mdx │ ├── Events.mdx │ ├── Extendable.mdx │ └── Slots.mdx ├── test ├── accordion.test.ts ├── alert.test.ts ├── badge.test.ts ├── breadcrumb.test.ts ├── button.element.test.ts ├── card.test.ts ├── checkbox.test.ts ├── close-button.test.ts ├── combo-box.test.ts ├── datepicker.test.ts ├── description-list-group.test.ts ├── description-list.test.ts ├── divider.test.ts ├── drawer.test.ts ├── dropdown.test.ts ├── fileupload.test.ts ├── footer.test.ts ├── generateId.test.ts ├── icon-button.test.ts ├── icon-list.test.ts ├── icon.test.ts ├── index.test.ts ├── input.element.test.ts ├── link-element.test.ts ├── link.test.ts ├── mainnav.test.ts ├── masthead.test.ts ├── modal.test.ts ├── overflow-menu.test.ts ├── pagination.test.ts ├── progress.test.ts ├── quantitytoggle.test.ts ├── radio.test.ts ├── sgds-web-component.ts ├── sidenav.test.ts ├── skeleton.test.ts ├── spinner.test.ts ├── stepper.test.ts ├── switch.test.ts ├── tab.test.ts ├── table-of-contents.test.ts ├── table.test.ts ├── textarea.test.ts ├── toast.test.ts ├── tooltip.element.test.ts └── utils │ └── time.test.ts ├── tsconfig.json ├── tsconfig.test.json ├── typings └── css.d.ts ├── vite.config.js └── web-test-runner.config.mjs /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/.DS_Store -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": [ 7 | "eslint:recommended", 8 | "plugin:@typescript-eslint/recommended", 9 | "plugin:wc/recommended", 10 | "plugin:lit/recommended" 11 | ], 12 | "plugins": ["sort-exports"], 13 | "overrides": [], 14 | "parserOptions": { 15 | "ecmaVersion": "latest", 16 | "sourceType": "module", 17 | "project": ["./tsconfig.json", "./tsconfig.test.json"] 18 | }, 19 | "rules": { 20 | "lit/attribute-value-entities": 0, 21 | "lit/no-invalid-html": 0, 22 | "lit/binding-positions": 0, 23 | "sort-exports/sort-exports": ["error", { "sortDir": "asc" }] 24 | // "jsx-quotes": [2, "prefer-single"], 25 | }, 26 | "ignorePatterns": ["**/*.js", "mocks", "**/*.mjs", "cypress", "cypress.config.ts", "**/*/icon-registry.ts"] 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/publish-latest.yml: -------------------------------------------------------------------------------- 1 | name: Publish Latest 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v[0-9]+.[0-9]+.[0-9]+' 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-node@v3 14 | with: 15 | node-version: 18 16 | registry-url: 'https://registry.npmjs.org' 17 | - run: npm ci 18 | - run: npx playwright install 19 | - run: npm run test 20 | - run: npm run build 21 | - run: npm publish --tag latest ./lib --access public 22 | env: 23 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/sync-to-gist.yml: -------------------------------------------------------------------------------- 1 | name: Sync to Lu Khei's Gist 2 | on: 3 | push: 4 | branches: 5 | - '3.0.0-alpha' 6 | - 'lab' 7 | jobs: 8 | Theme-Gist: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v4 13 | - name: Gist Repo Sync 14 | uses: pentatonicfunk/action-gist-repo-sync@v1.8 15 | with: 16 | gist_token: ${{ secrets.GIST_TOKEN }} 17 | gist_id: 425e29332ec837d9ea4bbe90ff8d4a37 18 | source_path: src/themes 19 | CSS-Gist: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout 23 | uses: actions/checkout@v4 24 | - name: Gist Repo Sync 25 | uses: pentatonicfunk/action-gist-repo-sync@v1.8 26 | with: 27 | gist_token: ${{ secrets.GIST_TOKEN }} 28 | gist_id: a31bfc0ea0c2b87d950b125f92835a76 29 | source_path: src/css -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | test-outdir 4 | storybook-static 5 | react 6 | src/react 7 | custom-elements.json 8 | stories/components 9 | stats.html 10 | *storybook.log -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npm run format && npm run lint:fix 5 | -------------------------------------------------------------------------------- /.husky/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | if [ -z "${2-}" ]; then 5 | # By default git hooks are not interactive. exec < /dev/tty allows a users terminal to interact with commitizen. 6 | exec < /dev/tty && npx cz --hook || true 7 | fi 8 | 9 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v18.16.0 2 | -------------------------------------------------------------------------------- /.storybook/manager-head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /.storybook/manager.js: -------------------------------------------------------------------------------- 1 | import { addons } from "@storybook/manager-api"; 2 | import sgdsTheme from "./sgdsTheme"; 3 | 4 | addons.setConfig({ 5 | theme: sgdsTheme, 6 | enableShortcuts: false 7 | }); 8 | -------------------------------------------------------------------------------- /.storybook/preview-head.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /.storybook/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/.storybook/static/logo.png -------------------------------------------------------------------------------- /.storybook/storybookVite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig, createLogger } from "vite"; 2 | 3 | export default defineConfig({}); 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "workbench.colorCustomizations": { 3 | "activityBar.background": "#203220", 4 | "titleBar.activeBackground": "#2C452D", 5 | "titleBar.activeForeground": "#FAFCFA" 6 | }, 7 | "todo-tree.highlights.customHighlight": { 8 | "TODO": { 9 | "icon": "check", 10 | "type": "line", 11 | "iconColour": "yellow", 12 | "foreground": "red", 13 | "background": "yellow" 14 | }, 15 | "FIXME": { 16 | "icon": "beaker", 17 | "iconColour": "red", 18 | "foreground": "white", 19 | "background": "red" 20 | } 21 | }, 22 | "typescript.tsdk": "node_modules/typescript/lib" 23 | } 24 | -------------------------------------------------------------------------------- /amplify.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | frontend: 3 | phases: 4 | preBuild: 5 | commands: 6 | - rm -rf node_modules && npm ci 7 | - npx playwright install 8 | build: 9 | commands: 10 | - npm run test && npm run test:scripts && npm run build-storybook 11 | artifacts: 12 | baseDirectory: /storybook-static 13 | files: 14 | - '**/*' 15 | # test: 16 | # phases: 17 | # test: 18 | # commands: 19 | # - npm run test 20 | # artifacts: 21 | # baseDirectory: coverage 22 | # configFilePath: '**/coverage-final.json' 23 | # files: '**/*' -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ["@commitlint/config-conventional"] }; 2 | -------------------------------------------------------------------------------- /coverage/lcov-report/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/coverage/lcov-report/favicon.png -------------------------------------------------------------------------------- /coverage/lcov-report/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | -------------------------------------------------------------------------------- /coverage/lcov-report/sort-arrow-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/coverage/lcov-report/sort-arrow-sprite.png -------------------------------------------------------------------------------- /coverage/lcov.info: -------------------------------------------------------------------------------- 1 | TN: 2 | SF:src/Button/button-element.ts 3 | FN:6, 4 | FNF:1 5 | FNH:0 6 | FNDA:0, 7 | DA:1,1 8 | DA:2,1 9 | DA:3,1 10 | DA:4,1 11 | DA:5,1 12 | DA:6,1 13 | DA:7,0 14 | DA:8,0 15 | DA:9,0 16 | DA:10,0 17 | DA:11,0 18 | DA:12,0 19 | DA:13,0 20 | DA:14,0 21 | DA:15,0 22 | DA:16,0 23 | DA:17,0 24 | DA:18,0 25 | DA:19,0 26 | DA:20,0 27 | LF:20 28 | LH:6 29 | BRDA:6,0,0,0 30 | BRF:1 31 | BRH:0 32 | end_of_record 33 | -------------------------------------------------------------------------------- /cypress.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "cypress"; 2 | 3 | export default defineConfig({ 4 | e2e: {} 5 | }); 6 | -------------------------------------------------------------------------------- /cypress/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/cypress/.DS_Store -------------------------------------------------------------------------------- /cypress/apps/angular-app/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/cypress/apps/angular-app/src/app/app.component.css -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-root", 5 | templateUrl: "./app.component.html" 6 | }) 7 | export class AppComponent { 8 | title = "sgds-wc-angular-app"; 9 | } 10 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig } from "@angular/core"; 2 | import { provideRouter } from "@angular/router"; 3 | 4 | import { routes } from "./app.routes"; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [provideRouter(routes)] 8 | }; 9 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from "@angular/router"; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/cypress/apps/angular-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/accordion/accordion.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "accordion-component", 5 | templateUrl: "./accordion.component.html" 6 | }) 7 | export class Accordion {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/alert/alert.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "alert-component", 5 | templateUrl: "./alert.component.html" 6 | }) 7 | export class Alert {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/badge/badge.component.html: -------------------------------------------------------------------------------- 1 | primary 2 | 3 | 4 | leftIcon slot 5 | 6 | 7 | 8 | rightIcon slot 9 | 10 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/badge/badge.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "badge-component", 5 | templateUrl: "./badge.component.html" 6 | }) 7 | export class Badge {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/breadcrumb/breadcrumb.component.html: -------------------------------------------------------------------------------- 1 | 2 | Home 3 | 4 | About 5 | 6 | 7 | Contacts 8 | 9 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/breadcrumb/breadcrumb.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "breadcrumb-component", 5 | templateUrl: "./breadcrumb.component.html" 6 | }) 7 | export class Breadcrumb {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/button/button.component.html: -------------------------------------------------------------------------------- 1 | primary secondary 2 | success danger 3 | warning info 4 | light dark 5 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/button/button.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "button-component", 5 | templateUrl: "./button.component.html" 6 | }) 7 | export class Button {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/card/card.component.html: -------------------------------------------------------------------------------- 1 | 2 | img alternate text goes here 4 | Card 5 | Some quick example text to build on the card title and make up the bulk of the card's 6 | content. 7 | Go somewhere 8 | 9 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/card/card.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "card-component", 5 | templateUrl: "./card.component.html" 6 | }) 7 | export class Card {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/checkbox/checkbox.component.html: -------------------------------------------------------------------------------- 1 | Check 2 | me 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/checkbox/checkbox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "checkbox-component", 5 | templateUrl: "./checkbox.component.html" 6 | }) 7 | export class Checkbox {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/combobox/combobox.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/combobox/combobox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "combobox-component", 5 | templateUrl: "./combobox.component.html" 6 | }) 7 | export class Combobox {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/datepicker/datepicker.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/datepicker/datepicker.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "datepicker-component", 5 | templateUrl: "./datepicker.component.html" 6 | }) 7 | export class Datepicker {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/descriptionlist/descriptionlist.component.html: -------------------------------------------------------------------------------- 1 | 2 | Description 3 | 4 | 5 | Label 1 6 | Data Text Description List 1 7 | 8 | 9 | 10 | Label 2 11 | Data Text Description List 2 12 | 13 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/descriptionlist/descriptionlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "description-list-component", 5 | templateUrl: "./descriptionlist.component.html" 6 | }) 7 | export class DescriptionList {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/divider/divider.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/divider/divider.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "divider-component", 5 | templateUrl: "./divider.component.html" 6 | }) 7 | export class Divider {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/drawer/drawer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ElementRef, ViewChild } from "@angular/core"; 2 | import SgdsDrawer from "@govtechsg/sgds-web-component/components/Drawer/sgds-drawer"; 3 | 4 | @Component({ 5 | selector: "drawer-component", 6 | templateUrl: "./drawer.component.html" 7 | }) 8 | export class Drawer { 9 | @ViewChild("drawer") 10 | drawer?: ElementRef; 11 | 12 | showDrawer() { 13 | this.drawer?.nativeElement.show(); 14 | } 15 | 16 | closeDrawer() { 17 | this.drawer?.nativeElement.hide(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/dropdown/dropdown.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "dropdown-component", 5 | templateUrl: "./dropdown.component.html" 6 | }) 7 | export class Dropdown {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/fileupload/fileupload.component.html: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | 8 | 9 | Choose a File 10 | 11 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/fileupload/fileupload.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "fileupload-component", 5 | templateUrl: "./fileupload.component.html" 6 | }) 7 | export class FileUpload {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "footer-component", 5 | templateUrl: "./footer.component.html" 6 | }) 7 | export class Footer {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/icon/icon.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/icon/icon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "icon-component", 5 | templateUrl: "./icon.component.html" 6 | }) 7 | export class Icon {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/iconbutton/iconbutton.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/iconbutton/iconbutton.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "icon-button-component", 5 | templateUrl: "./iconbutton.component.html" 6 | }) 7 | export class IconButton {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/iconlist/iconlist.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | item one 4 |
5 |
6 | item one 7 |
8 |
9 | item one 10 |
11 |
-------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/iconlist/iconlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "icon-list-component", 5 | templateUrl: "./iconlist.component.html" 6 | }) 7 | export class IconList {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/input/input.component.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/input/input.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "input-component", 5 | templateUrl: "./input.component.html" 6 | }) 7 | export class Input {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/link/link.component.html: -------------------------------------------------------------------------------- 1 | 2 | light dom anchor 3 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/link/link.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "link-component", 5 | templateUrl: "./link.component.html" 6 | }) 7 | export class Link {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/mainnav/mainnav.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ArgsTable Controlled 4 | 5 | Dropdown 6 | Item 1 7 | Item 2 8 | Item 3 9 | 10 | About 11 | Contact Us 12 | Login 13 | 15 | 16 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/mainnav/mainnav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "mainnav-component", 5 | templateUrl: "./mainnav.component.html" 6 | }) 7 | export class Mainnav {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/masthead/masthead.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/masthead/masthead.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "masthead-component", 5 | templateUrl: "./masthead.component.html" 6 | }) 7 | export class Masthead {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/modal/modal.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ElementRef, ViewChild } from "@angular/core"; 2 | import SgdsModal from "@govtechsg/sgds-web-component/components/Modal/sgds-modal"; 3 | 4 | @Component({ 5 | selector: "modal-component", 6 | templateUrl: "./modal.component.html" 7 | }) 8 | export class Modal { 9 | @ViewChild("modal") 10 | modal?: ElementRef; 11 | 12 | showModal() { 13 | this.modal?.nativeElement.show(); 14 | } 15 | 16 | closeModal() { 17 | this.modal?.nativeElement.hide(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/pagination/pagination.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/pagination/pagination.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "pagination-component", 5 | templateUrl: "./pagination.component.html" 6 | }) 7 | export class Pagination {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/progressbar/progressbar.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/progressbar/progressbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "progress-bar-component", 5 | templateUrl: "./progressbar.component.html" 6 | }) 7 | export class ProgressBar {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/quantitytoggle/quantitytoggle.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/quantitytoggle/quantitytoggle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "quantitytoggle-component", 5 | templateUrl: "./quantitytoggle.component.html" 6 | }) 7 | export class QuantityToggle {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/radio/radio.component.html: -------------------------------------------------------------------------------- 1 | 2 | Select an option 3 | Option 1 4 | Option 2 5 | Option 3 6 | 7 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/radio/radio.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "radio-component", 5 | templateUrl: "./radio.component.html" 6 | }) 7 | export class Radio {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/sidenav/sidenav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "sidenav-component", 5 | templateUrl: "./sidenav.component.html" 6 | }) 7 | export class Sidenav {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/skeleton/skeleton.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/skeleton/skeleton.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "skeleton-component", 5 | templateUrl: "./skeleton.component.html" 6 | }) 7 | export class Skeleton {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/spinner/spinner.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/spinner/spinner.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "spinner-component", 5 | templateUrl: "./spinner.component.html" 6 | }) 7 | export class Spinner {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/stepper/stepper.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/stepper/stepper.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "stepper-component", 5 | templateUrl: "./stepper.component.html" 6 | }) 7 | export class Stepper { 8 | steps = [ 9 | { 10 | stepHeader: "Personal Details", 11 | component: "1 test" 12 | }, 13 | { 14 | stepHeader: "Address and Contact Information", 15 | component: "2 test" 16 | }, 17 | { 18 | stepHeader: "Review", 19 | component: "3 test" 20 | } 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/switch/switch.component.html: -------------------------------------------------------------------------------- 1 | Switch 2 | Switch with icon 3 | Switch with icon 4 | Switch with icon 5 | Switch 6 | Switch 7 | Switch 8 | Switch -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/switch/switch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "switch-component", 5 | templateUrl: "./switch.component.html" 6 | }) 7 | export class Switch {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/tab/tab.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "tab-component", 5 | templateUrl: "./tab.component.html" 6 | }) 7 | export class Tab {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/table/table.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "table-component", 5 | templateUrl: "./table.component.html" 6 | }) 7 | export class Table {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/tableofcontents/tableofcontents.component.html: -------------------------------------------------------------------------------- 1 | 2 |

Header

3 |
  • 4 | 5 | Link 6 | 7 |
  • 8 |
  • 9 | 10 | Link 11 | 12 |
  • 13 |
  • 14 | 15 | Link 16 | 17 |
  • 18 |
  • 19 | 20 | Link 21 | 22 |
  • 23 |
    -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/tableofcontents/tableofcontents.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "table-of-contents-component", 5 | templateUrl: "./tableofcontents.component.html" 6 | }) 7 | export class TableOfContents {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/textarea/textarea.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/textarea/textarea.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "textarea-component", 5 | templateUrl: "./textarea.component.html" 6 | }) 7 | export class Textarea {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/toast/toast.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Action 5 | This is a toast notifications 6 | 7 | 8 | 9 | Action 10 | This is a toast notifications 11 | 12 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/toast/toast.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "toast-component", 5 | templateUrl: "./toast.component.html" 6 | }) 7 | export class Toast {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/tooltip/tooltip.component.html: -------------------------------------------------------------------------------- 1 | Hover over the icon 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 14 | 15 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/components/tooltip/tooltip.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "tooltip-component", 5 | templateUrl: "./tooltip.component.html" 6 | }) 7 | export class Tooltip {} 8 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; 2 | import { AppModule } from "./app/app.module"; 3 | 4 | platformBrowserDynamic() 5 | .bootstrapModule(AppModule) 6 | .catch(err => console.error(err)); 7 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "esModuleInterop": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "experimentalDecorators": true, 16 | "moduleResolution": "node", 17 | "importHelpers": true, 18 | "target": "ES2022", 19 | "module": "ESNext", 20 | "useDefineForClassFields": false, 21 | "lib": ["ES2022", "dom"] 22 | }, 23 | "angularCompilerOptions": { 24 | "enableI18nLegacyMessageIdFormat": false, 25 | "strictInjectionParameters": true, 26 | "strictInputAccessModifiers": true, 27 | "strictTemplates": true 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /cypress/apps/angular-app/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /cypress/apps/next-app/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /cypress/apps/next-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /cypress/apps/next-app/next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | images: { 4 | domains: ['images.unsplash.com'], 5 | }, 6 | // webpack: (config, options) => { 7 | // const originalEntry = config.entry 8 | // config.entry = async () => { 9 | // const entries = await originalEntry() 10 | // console.log(entries) 11 | // if (entries['main.js']) { 12 | // // Load polyfills only in the client. 13 | // if (!options.isServer && !entries['main.js'].includes('./src/polyfills.ts')) { 14 | // entries['main.js'].unshift('./src/polyfills.ts') 15 | // } 16 | // } 17 | 18 | // return entries 19 | // } 20 | 21 | // return config 22 | // } 23 | }; 24 | 25 | export default nextConfig; 26 | -------------------------------------------------------------------------------- /cypress/apps/next-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev --port 3002", 7 | "build": "next build", 8 | "start": "next start --port 3002", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@govtechsg/sgds-web-component": "file:../../../lib", 13 | "next": "14.2.3", 14 | "react": "^18", 15 | "react-dom": "^18" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^20", 19 | "@types/react": "^18", 20 | "@types/react-dom": "^18", 21 | "eslint": "^8", 22 | "eslint-config-next": "14.2.3", 23 | "typescript": "^5" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /cypress/apps/next-app/public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Badge.tsx: -------------------------------------------------------------------------------- 1 | import SgdsBadge from "@govtechsg/sgds-web-component/react/badge/index.js"; 2 | 3 | export const Badge = () => { 4 | return ( 5 | <> 6 | primary 7 | 8 | 9 | leftIcon slot 10 | 11 | 12 | 13 | rightIcon slot 14 | 15 | 16 | 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Button.tsx: -------------------------------------------------------------------------------- 1 | import SgdsButton from "@govtechsg/sgds-web-component/react/button/index.js"; 2 | 3 | export const Button = () => { 4 | return ( 5 | <> 6 | primary 7 | secondary 8 | success 9 | danger 10 | warning 11 | info 12 | light 13 | dark 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Card.tsx: -------------------------------------------------------------------------------- 1 | import SgdsCard from "@govtechsg/sgds-web-component/react/card/index.js"; 2 | import Image from "next/image"; 3 | export const Card = () => { 4 | return ( 5 | <> 6 | 7 | img alternate text goes here 15 | Card 16 | 17 | Some quick example text to build on the card title and make up the bulk of the card's content. 18 | 19 | 20 | Go somewhere 21 | 22 | 23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Checkbox.tsx: -------------------------------------------------------------------------------- 1 | import SgdsCheckbox from "@govtechsg/sgds-web-component/react/checkbox/index.js"; 2 | import SgdsCheckboxGroup from "@govtechsg/sgds-web-component/react/checkbox-group/index.js"; 3 | 4 | export const Checkbox = () => { 5 | return ( 6 | <> 7 | 8 | Option 1 9 | 10 | Option 2 indeterminate 11 | 12 | 13 | Option 3 14 | 15 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Datepicker.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from "next/dynamic" 2 | const SgdsDatepicker = dynamic( 3 | () => import("@govtechsg/sgds-web-component/react/datepicker/index.js"), 4 | { 5 | ssr: false, 6 | } 7 | ); 8 | export const Datepicker = () => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/DescriptionList.tsx: -------------------------------------------------------------------------------- 1 | import SgdsDescriptionList from "@govtechsg/sgds-web-component/react/description-list/index.js"; 2 | import SgdsDescriptionListGroup from "@govtechsg/sgds-web-component/react/description-list-group/index.js"; 3 | 4 | export const DescriptionList = () => { 5 | return ( 6 | <> 7 | 8 | Description 9 | 10 | Label 1Data Text Description List 1 11 | 12 | 13 | Label 2Data Text Description List 2 14 | 15 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Divider.tsx: -------------------------------------------------------------------------------- 1 | import SgdsDivider from "@govtechsg/sgds-web-component/react/divider/index.js"; 2 | 3 | export const Divider = () => { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Dropdown.tsx: -------------------------------------------------------------------------------- 1 | import SgdsDropdownItem from "@govtechsg/sgds-web-component/react/dropdown-item/index.js"; 2 | import dynamic from "next/dynamic"; 3 | const SgdsDropdown = dynamic(() => import("@govtechsg/sgds-web-component/react/dropdown/index.js"), { 4 | ssr: false 5 | }); 6 | import SgdsButton from "@govtechsg/sgds-web-component/react/button/index.js"; 7 | 8 | export const Dropdown = () => { 9 | return ( 10 |
    11 | 12 | Dropdown 13 | item #1 (argsTable controlled) 14 | item #2 15 | item #3 16 | 17 |
    18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/FileUpload.tsx: -------------------------------------------------------------------------------- 1 | import SgdsFileUpload from "@govtechsg/sgds-web-component/react/file-upload/index.js"; 2 | 3 | export const FileUpload = () => { 4 | return ( 5 | 6 | 14 | 15 | 16 | 17 | Choose a File 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Footer.tsx: -------------------------------------------------------------------------------- 1 | import SgdsFooter from "@govtechsg/sgds-web-component/react/footer/index.js"; 2 | import SgdsIcon from "@govtechsg/sgds-web-component/react/icon/index.js"; 3 | 4 | export const Footer = () => { 5 | return ( 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Icon.tsx: -------------------------------------------------------------------------------- 1 | import SgdsIcon from "@govtechsg/sgds-web-component/react/icon/index.js"; 2 | 3 | export const Icon = () => { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/IconButton.tsx: -------------------------------------------------------------------------------- 1 | import SgdsIconButton from "@govtechsg/sgds-web-component/react/icon-button/index.js"; 2 | 3 | export const IconButton = () => { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | 11 | ); 12 | }; 13 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/IconList.tsx: -------------------------------------------------------------------------------- 1 | import SgdsIcon from "@govtechsg/sgds-web-component/react/icon/index.js"; 2 | import SgdsIconList from "@govtechsg/sgds-web-component/react/icon-list/index.js"; 3 | 4 | export const IconList = () => { 5 | return ( 6 | <> 7 | 8 |
    9 | item one 10 |
    11 |
    12 | item one 13 |
    14 |
    15 | item one 16 |
    17 |
    18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Input.tsx: -------------------------------------------------------------------------------- 1 | import SgdsInput from "@govtechsg/sgds-web-component/react/input/index.js"; 2 | 3 | export const Input = () => { 4 | return ( 5 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Link.tsx: -------------------------------------------------------------------------------- 1 | import SgdsLink from "@govtechsg/sgds-web-component/react/link/index.js"; 2 | import SgdsIcon from "@govtechsg/sgds-web-component/react/icon/index.js"; 3 | 4 | export const Link = () => { 5 | return ( 6 | <> 7 | 8 | 9 | light dom anchor 10 | 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Masthead.tsx: -------------------------------------------------------------------------------- 1 | import SgdsMasthead from "@govtechsg/sgds-web-component/react/masthead/index.js"; 2 | 3 | export const Masthead = () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Pagination.tsx: -------------------------------------------------------------------------------- 1 | import SgdsPagination from "@govtechsg/sgds-web-component/react/pagination/index.js"; 2 | 3 | export const Pagination = () => { 4 | return ( 5 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/ProgressBar.tsx: -------------------------------------------------------------------------------- 1 | import SgdsProgressBar from "@govtechsg/sgds-web-component/react/progress-bar/index.js"; 2 | 3 | export const ProgressBar = () => { 4 | return ( 5 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/QuantityToggle.tsx: -------------------------------------------------------------------------------- 1 | import SgdsQuantityToggle from "@govtechsg/sgds-web-component/react/quantity-toggle/index.js"; 2 | 3 | export const QuantityToggle = () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Radio.tsx: -------------------------------------------------------------------------------- 1 | import SgdsRadio from "@govtechsg/sgds-web-component/react/radio/index.js"; 2 | import SgdsRadioGroup from "@govtechsg/sgds-web-component/react/radio-group/index.js"; 3 | 4 | export const Radio = () => { 5 | return ( 6 | 7 | Select an option 8 | Option 1 9 | Option 2 10 | Option 3 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Skeleton.jsx: -------------------------------------------------------------------------------- 1 | import SgdsSkeleton from "@govtechsg/sgds-web-component/react/skeleton"; 2 | 3 | export const Skeleton = () => { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Spinner.tsx: -------------------------------------------------------------------------------- 1 | import SgdsSpinner from "@govtechsg/sgds-web-component/react/spinner/index.js"; 2 | 3 | export const Spinner = () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Stepper.tsx: -------------------------------------------------------------------------------- 1 | import SgdsStepper from "@govtechsg/sgds-web-component/react/stepper/index.js"; 2 | import { useMemo } from "react"; 3 | 4 | export const Stepper = () => { 5 | const steps = useMemo( 6 | () => [ 7 | { 8 | stepHeader: "Personal Details", 9 | component: "1 test" 10 | }, 11 | { 12 | stepHeader: "Address and Contact Information", 13 | component: "2 test" 14 | }, 15 | { 16 | stepHeader: "Review", 17 | component: "3 test" 18 | } 19 | ], 20 | [] 21 | ); 22 | 23 | return ; 24 | }; 25 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Switch.tsx: -------------------------------------------------------------------------------- 1 | import SgdsSwitch from "@govtechsg/sgds-web-component/react/switch/index.js"; 2 | 3 | export const Switch = () => { 4 | return ( 5 | <> 6 | Switch 7 | Switch with icon 8 | 9 | Switch with icon 10 | 11 | 12 | Switch with icon 13 | 14 | Switch 15 | Switch 16 | Switch 17 | 18 | Switch 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/TableOfContents.tsx: -------------------------------------------------------------------------------- 1 | import SgdsTableOfContents from "@govtechsg/sgds-web-component/react/table-of-contents/index.js"; 2 | import SgdsLink from "@govtechsg/sgds-web-component/react/link/index.js"; 3 | 4 | export const TableOfContents = () => { 5 | return ( 6 | <> 7 | 8 |

    Header

    9 |
  • 10 | 11 | Link 12 | 13 |
  • 14 |
  • 15 | 16 | Link 17 | 18 |
  • 19 |
  • 20 | 21 | Link 22 | 23 |
  • 24 |
  • 25 | 26 | Link 27 | 28 |
  • 29 |
    30 | 31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Textarea.tsx: -------------------------------------------------------------------------------- 1 | import SgdsTextarea from "@govtechsg/sgds-web-component/react/textarea/index.js"; 2 | 3 | export const Textarea = () => { 4 | return ( 5 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/components/Toast.tsx: -------------------------------------------------------------------------------- 1 | import SgdsToast from "@govtechsg/sgds-web-component/react/toast/index.js"; 2 | import SgdsToastContainer from "@govtechsg/sgds-web-component/react/toast-container/index.js"; 3 | import SgdsIcon from "@govtechsg/sgds-web-component/react/icon/index.js"; 4 | import SgdsLink from "@govtechsg/sgds-web-component/react/link/index.js"; 5 | 6 | export const Toast = () => { 7 | return ( 8 | 9 | 10 | 11 | 12 | Action 13 | 14 | This is a toast notifications 15 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/cypress/apps/next-app/src/app/favicon.ico -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/globals.css: -------------------------------------------------------------------------------- 1 | @import url("@govtechsg/sgds-web-component/themes/day.css"); 2 | @import url("@govtechsg/sgds-web-component/css/reboot.css"); -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | 5 | 6 | const inter = Inter({ subsets: ["latin"] }); 7 | 8 | export const metadata: Metadata = { 9 | title: "Create Next App", 10 | description: "Generated by create next app" 11 | }; 12 | 13 | export default function RootLayout({ 14 | children 15 | }: Readonly<{ 16 | children: React.ReactNode; 17 | }>) { 18 | return ( 19 | 20 | 21 | {/* */} 22 | {children} 23 | {/* */} 24 | 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /cypress/apps/next-app/src/app/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/cypress/apps/next-app/src/app/page.module.css -------------------------------------------------------------------------------- /cypress/apps/next-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./src/*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /cypress/apps/next-app/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module "@webcomponents/scoped-custom-element-registry"; 2 | -------------------------------------------------------------------------------- /cypress/apps/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Badge.jsx: -------------------------------------------------------------------------------- 1 | import SgdsBadge from "@govtechsg/sgds-web-component/react/badge"; 2 | 3 | export const Badge = () => { 4 | return ( 5 | <> 6 | primary 7 | 8 | 9 | leftIcon slot 10 | 11 | 12 | 13 | rightIcon slot 14 | 15 | 16 | 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Breadcrumb.jsx: -------------------------------------------------------------------------------- 1 | import SgdsBreadcrumb from "@govtechsg/sgds-web-component/react/breadcrumb"; 2 | import SgdsBreadcrumbItem from "@govtechsg/sgds-web-component/react/breadcrumb-item"; 3 | 4 | export const Breadcrumb = () => { 5 | return ( 6 | 7 | 8 | Home 9 | 10 | 11 | Home 12 | 13 | Home 14 | Home 15 | Last Item 16 | 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Button.jsx: -------------------------------------------------------------------------------- 1 | import SgdsButton from "@govtechsg/sgds-web-component/react/button"; 2 | 3 | export const Button = () => { 4 | return ( 5 | <> 6 | primary 7 | secondary 8 | success 9 | danger 10 | warning 11 | info 12 | light 13 | dark 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Card.jsx: -------------------------------------------------------------------------------- 1 | import SgdsCard from "@govtechsg/sgds-web-component/react/card"; 2 | 3 | export const Card = () => { 4 | return ( 5 | <> 6 | 7 | img alternate text goes here 12 | Card 13 | 14 | Some quick example text to build on the card title and make up the bulk of the card's content. 15 | 16 | 17 | Go somewhere 18 | 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Combobox.jsx: -------------------------------------------------------------------------------- 1 | import SgdsCombobox from "@govtechsg/sgds-web-component/react/combo-box"; 2 | 3 | export const Combobox = () => { 4 | return ( 5 | 13 | 14 | ) 15 | } -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Datepicker.jsx: -------------------------------------------------------------------------------- 1 | import SgdsDatepicker from "@govtechsg/sgds-web-component/react/datepicker"; 2 | 3 | export const Datepicker = () => { 4 | return ( 5 | 6 | 7 | ) 8 | } 9 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Divider.jsx: -------------------------------------------------------------------------------- 1 | import SgdsDivider from "@govtechsg/sgds-web-component/react/divider"; 2 | 3 | export const Divider = () => { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Drawer.jsx: -------------------------------------------------------------------------------- 1 | import SgdsButton from "@govtechsg/sgds-web-component/react/button"; 2 | import SgdsDrawer from "@govtechsg/sgds-web-component/react/drawer"; 3 | import { useRef } from "react"; 4 | 5 | export const Drawer = () => { 6 | const drawerRef = useRef(null); 7 | 8 | const showDrawer = () => { 9 | drawerRef.current?.show(); 10 | }; 11 | const closeDrawer = () => { 12 | drawerRef.current?.hide(); 13 | }; 14 | 15 | return ( 16 | <> 17 | Open end Drawer 18 | 19 | This is a Drawer 20 | Close 21 | Submit 22 | 23 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Dropdown.jsx: -------------------------------------------------------------------------------- 1 | import SgdsDropdown from "@govtechsg/sgds-web-component/react/dropdown"; 2 | import SgdsDropdownItem from "@govtechsg/sgds-web-component/react/dropdown-item"; 3 | import SgdsButton from "@govtechsg/sgds-web-component/react/button" 4 | export const Dropdown = () => { 5 | return ( 6 | 7 | Dropdown 8 | item #1 (argsTable controlled) 9 | item #2 10 | item #3 11 | 12 | ) 13 | } -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/FileUpload.jsx: -------------------------------------------------------------------------------- 1 | import SgdsFileUpload from "@govtechsg/sgds-web-component/react/file-upload"; 2 | 3 | export const FileUpload = () => { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | Choose a File 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/IconButton.jsx: -------------------------------------------------------------------------------- 1 | import IButton from "@govtechsg/sgds-web-component/react/icon-button"; 2 | import Icon from "@govtechsg/sgds-web-component/react/icon" 3 | export const IconButton = () => { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Masthead.jsx: -------------------------------------------------------------------------------- 1 | import SgdsMasthead from "@govtechsg/sgds-web-component/react/masthead"; 2 | 3 | export const Masthead = () => { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Pagination.jsx: -------------------------------------------------------------------------------- 1 | import SgdsPagination from "@govtechsg/sgds-web-component/react/pagination"; 2 | 3 | export const Pagination = () => { 4 | return ( 5 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/ProgressBar.jsx: -------------------------------------------------------------------------------- 1 | import SgdsProgressBar from "@govtechsg/sgds-web-component/react/progress-bar"; 2 | 3 | export const ProgressBar = () => { 4 | return ( 5 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/QuantityToggle.jsx: -------------------------------------------------------------------------------- 1 | import SgdsQuantityToggle from "@govtechsg/sgds-web-component/react/quantity-toggle"; 2 | 3 | export const QuantityToggle = () => { 4 | return 9 | } 10 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Radio.jsx: -------------------------------------------------------------------------------- 1 | import SgdsRadio from "@govtechsg/sgds-web-component/react/radio"; 2 | import SgdsRadioGroup from "@govtechsg/sgds-web-component/react/radio-group"; 3 | 4 | export const Radio = () => { 5 | return ( 6 | 7 | Select an option 8 | Option 1 9 | Option 2 10 | Option 3 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Skeleton.jsx: -------------------------------------------------------------------------------- 1 | import SgdsSkeleton from "@govtechsg/sgds-web-component/react/skeleton"; 2 | 3 | export const Skeleton = () => { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Spinner.jsx: -------------------------------------------------------------------------------- 1 | import SgdsSpinner from "@govtechsg/sgds-web-component/react/spinner"; 2 | 3 | export const Spinner = () => { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Stepper.jsx: -------------------------------------------------------------------------------- 1 | import SgdsStepper from "@govtechsg/sgds-web-component/react/stepper"; 2 | import { useMemo } from "react" 3 | 4 | export const Stepper = () => { 5 | const steps = useMemo(() => [ 6 | { 7 | stepHeader: "Personal Details", 8 | component: "1 test" 9 | }, 10 | { 11 | stepHeader: "Address and Contact Information", 12 | component: "2 test" 13 | }, 14 | { 15 | stepHeader: "Review", 16 | component: "3 test" 17 | } 18 | ], []) 19 | 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Table.jsx: -------------------------------------------------------------------------------- 1 | import SgdsTable from "@govtechsg/sgds-web-component/react/table"; 2 | 3 | export const Table = () => { 4 | return ( 5 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Textarea.jsx: -------------------------------------------------------------------------------- 1 | import SgdsTextarea from "@govtechsg/sgds-web-component/react/textarea"; 2 | 3 | export const Textarea = () => { 4 | return 13 | } 14 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/components/Tooltip.jsx: -------------------------------------------------------------------------------- 1 | import SgdsTooltip from "@govtechsg/sgds-web-component/react/tooltip"; 2 | 3 | export const Tooltip = () => { 4 | return ( 5 | <> 6 | Hover over the icon 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/index.css: -------------------------------------------------------------------------------- 1 | 2 | :root{ 3 | --sgds-primary: #0161AF; 4 | } -------------------------------------------------------------------------------- /cypress/apps/react-app/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import App from "./App"; 4 | import reportWebVitals from "./reportWebVitals"; 5 | 6 | const root = ReactDOM.createRoot(document.getElementById("root")); 7 | root.render( 8 | 9 | 10 | 11 | ); 12 | 13 | // If you want to start measuring performance in your app, pass a function 14 | // to log results (for example: reportWebVitals(console.log)) 15 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 16 | reportWebVitals(); 17 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /cypress/apps/react-app/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import "@testing-library/jest-dom"; 6 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vue app 7 | 8 | 9 |
    10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-app", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "vite --host 127.0.0.1 --port 3001", 7 | "build": "run-p type-check \"build-only {@}\" --", 8 | "preview": "vite preview", 9 | "build-only": "vite build", 10 | "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false" 11 | }, 12 | "dependencies": { 13 | "@govtechsg/sgds": "^2.1.1", 14 | "@govtechsg/sgds-web-component": "file:../../../lib", 15 | "@webcomponents/scoped-custom-element-registry": "^0.0.9", 16 | "vue": "^3.3.4" 17 | }, 18 | "devDependencies": { 19 | "@tsconfig/node18": "^18.2.2", 20 | "@types/node": "^18.18.5", 21 | "@vitejs/plugin-vue": "^4.4.0", 22 | "@vue/tsconfig": "^0.4.0", 23 | "npm-run-all2": "^6.1.1", 24 | "typescript": "~5.2.0", 25 | "vite": "^4.5.5", 26 | "vue-tsc": "^2.0.29" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Alert.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Badge.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Button.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Checkbox.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Datepicker.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Divider.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Drawer.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/FileUpload.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Footer.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Icon.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/IconButton.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Input.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Link.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Mainnav.vue: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Masthead.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Pagination.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/ProgressBar.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/QuantityToggle.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Radio.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Skeleton.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Spinner.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Stepper.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Switch.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/TableOfContents.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Textarea.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Toast.vue: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/components/Trigger.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | 4 | createApp(App).mount("#app"); 5 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "baseUrl": ".", 8 | "paths": { 9 | "@/*": ["./src/*"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.app.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18/tsconfig.json", 3 | "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "nightwatch.conf.*", "playwright.config.*"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "module": "ESNext", 7 | "moduleResolution": "Bundler", 8 | "types": ["node"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /cypress/apps/vue-app/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from "node:url"; 2 | 3 | import { defineConfig } from "vite"; 4 | import vue from "@vitejs/plugin-vue"; 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [ 9 | vue({ 10 | template: { 11 | compilerOptions: { 12 | // treat all tags that starts with sgds as custom elements 13 | isCustomElement: tag => tag.includes("sgds-") 14 | } 15 | } 16 | }) 17 | ], 18 | resolve: { 19 | alias: { 20 | "@": fileURLToPath(new URL("./src", import.meta.url)) 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /cypress/e2e/angular.spec.cy.ts: -------------------------------------------------------------------------------- 1 | describe("run angular-app", () => { 2 | it("should run the app successfully", () => { 3 | cy.visit("http://127.0.0.1:4200/"); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /cypress/e2e/next.spec.cy.ts: -------------------------------------------------------------------------------- 1 | describe("run next-app", () => { 2 | it("should run the app successfully", () => { 3 | cy.visit("http://127.0.0.1:3002/"); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /cypress/e2e/react.spec.cy.ts: -------------------------------------------------------------------------------- 1 | describe("run react-app", () => { 2 | it("should run the app successfully", () => { 3 | cy.visit("http://127.0.0.1:3000/"); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /cypress/e2e/vue.spec.cy.ts: -------------------------------------------------------------------------------- 1 | describe("run vue-app", () => { 2 | it("should run the app successfully", () => { 3 | cy.visit("http://127.0.0.1:3001/"); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /cypress/scripts/run_angular.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run angular-app (Angular v17.0.0) on host 127.0.0.1, port 4200 4 | 5 | SCRIPT_DIR=$(dirname "$0") 6 | 7 | cd "${SCRIPT_DIR}/../apps/angular-app" 8 | npm install 9 | npm start 10 | -------------------------------------------------------------------------------- /cypress/scripts/run_next.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run next-app (Next 14.0.0) on host 127.0.0.1, port 3002 4 | 5 | SCRIPT_DIR=$(dirname "$0") 6 | 7 | cd "${SCRIPT_DIR}/../apps/next-app" 8 | nvm use 20 9 | npm install 10 | npm run build 11 | npm run start 12 | -------------------------------------------------------------------------------- /cypress/scripts/run_react.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run react-app (React v18.2.0) on host 127.0.0.1, port 3000 4 | 5 | SCRIPT_DIR=$(dirname "$0") 6 | 7 | cd "${SCRIPT_DIR}/../apps/react-app" 8 | npm install 9 | npm start 10 | -------------------------------------------------------------------------------- /cypress/scripts/run_vue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run vue-app (Vue v3.3.4) on host 127.0.0.1, port 3001 4 | 5 | SCRIPT_DIR=$(dirname "$0") 6 | 7 | cd "${SCRIPT_DIR}/../apps/vue-app" 8 | npm install 9 | npm run dev 10 | -------------------------------------------------------------------------------- /cypress/support/e2e.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/e2e.ts is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import "./commands"; 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /cypress/support/index.ts: -------------------------------------------------------------------------------- 1 | import failOnConsoleError from "cypress-fail-on-console-error"; 2 | 3 | failOnConsoleError(); 4 | -------------------------------------------------------------------------------- /cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["es5", "dom"], 5 | "types": ["cypress", "node"] 6 | }, 7 | "include": ["**/*.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /docs/HEADER.md: -------------------------------------------------------------------------------- 1 |   2 |   3 |   4 | 5 | # sgds-web-component 6 | -------------------------------------------------------------------------------- /docs/Slots.md: -------------------------------------------------------------------------------- 1 | # Slots 2 | 3 | The [HTMl slot elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) are placeholders inside the web components that you can fill up with your own HTML markups. 4 | 5 | There are two kinds of slots: default and named slots. In the storybook documentation, slots are found under the API table with their names. If the name of a slot is default, it means that it is a default slot. For all other names, they are named slots. 6 | 7 | Handle the usage of the default slot and named slot as below 8 | 9 | 1. default slot : `` 10 | 11 | ```html 12 | 13 | Hello World 14 | 15 | ``` 16 | 17 | "Hello World" span element is placed in the default slot 18 | 19 | 2. named slot : `` 20 | 21 | ```html 22 | 23 | 24 | Hello World 25 | 26 | 27 | 28 | ``` 29 | 30 | The svg element with attribute `slot=icon` is placed in the named slot 31 | -------------------------------------------------------------------------------- /docs/Status.md: -------------------------------------------------------------------------------- 1 | # Status 2 | -------------------------------------------------------------------------------- /mocks/dropdown.d.ts: -------------------------------------------------------------------------------- 1 | import { DropdownElement } from "../src/base/dropdown-element"; 2 | export declare class MockDropdown extends DropdownElement { 3 | render(): import("lit-html").TemplateResult<1>; 4 | } 5 | -------------------------------------------------------------------------------- /mocks/link.d.ts: -------------------------------------------------------------------------------- 1 | import LinkElement from "../src/base/link-element"; 2 | export declare class MockLink extends LinkElement {} 3 | -------------------------------------------------------------------------------- /mocks/link.ts: -------------------------------------------------------------------------------- 1 | import { customElement } from "lit/decorators.js"; 2 | import LinkElement from "../src/base/link-element"; 3 | 4 | @customElement("mock-link") 5 | export class MockLink extends LinkElement {} 6 | -------------------------------------------------------------------------------- /plop-templates/basic.hbs: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | export const Template = args => 4 | html`` 5 | 6 | 7 | export const args = {}; 8 | 9 | export const parameters= {}; 10 | -------------------------------------------------------------------------------- /plop-templates/component.hbs: -------------------------------------------------------------------------------- 1 | import SgdsElement from "../../base/sgds-element"; 2 | import { html } from "lit"; 3 | 4 | export class Sgds{{main-component-name}} extends SgdsElement { 5 | 6 | render(){ 7 | return html`` 8 | } 9 | } 10 | 11 | export default Sgds{{main-component-name}}; -------------------------------------------------------------------------------- /plop-templates/index.hbs: -------------------------------------------------------------------------------- 1 | import { Sgds{{main-component-name}} } from "./sgds-{{kebabCase main-component-name}}"; 2 | 3 | customElements.define("sgds-{{kebabCase main-component-name}}", Sgds{{main-component-name}}); 4 | 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-{{kebabCase main-component-name}}": Sgds{{main-component-name}}; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /plop-templates/test.hbs: -------------------------------------------------------------------------------- 1 | import { html } from "lit"; 2 | import {expect } from "@open-wc/testing"; 3 | import { Sgds{{main-component-name}} } from "../src/components"; 4 | import "../src/index"; 5 | 6 | describe("", () => {}); -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | arrowParens: "avoid", 4 | bracketSpacing: true, 5 | htmlWhitespaceSensitivity: "css", 6 | insertPragma: false, 7 | bracketSameLine: false, 8 | singleQuote: false, 9 | printWidth: 120, 10 | proseWrap: "preserve", 11 | quoteProps: "as-needed", 12 | requirePragma: false, 13 | semi: true, 14 | tabWidth: 2, 15 | trailingComma: "none", 16 | useTabs: false 17 | }; 18 | -------------------------------------------------------------------------------- /scripts/buildUtils.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | 3 | exports.getFolders = entry => { 4 | const dirs = fs.readdirSync(entry); 5 | const dirsWithoutIndex = dirs 6 | .filter(name => name !== "index.ts") 7 | .filter(name => name !== "entry.ts") 8 | .filter(name => name !== "utils") 9 | .filter(name => name !== "react") 10 | .filter(name => name !== "base"); 11 | return dirsWithoutIndex; 12 | }; 13 | 14 | exports.getFiles = (entry, extensions = [], excludeExtensions = []) => { 15 | let fileNames = []; 16 | const dirs = fs.readdirSync(entry); 17 | dirs.forEach(dir => { 18 | const path = `${entry}/${dir}`; 19 | 20 | if (fs.lstatSync(path).isDirectory()) { 21 | fileNames = [...fileNames, ...getFiles(path, extensions, excludeExtensions)]; 22 | 23 | return; 24 | } 25 | 26 | if (!excludeExtensions.some(exclude => dir.endsWith(exclude)) && extensions.some(ext => dir.endsWith(ext))) { 27 | fileNames.push(path); 28 | } 29 | }); 30 | return fileNames; 31 | }; 32 | -------------------------------------------------------------------------------- /scripts/methodsTable.mjs: -------------------------------------------------------------------------------- 1 | export const methodsTable = metaArr => 2 | // const accordionModule = modules[0] 3 | metaArr.map(component => ({ 4 | tagName: component.tagName, 5 | methods: component.members.filter(member => member.kind === "method" && member.privacy === "public") 6 | })); 7 | 8 | export const writeParams = metaObj => { 9 | if ("parameters" in metaObj && metaObj.parameters.length > 0) { 10 | const { parameters } = metaObj; 11 | return parameters 12 | .map(param => 13 | piecingParam(param) 14 | ) 15 | .join(", "); 16 | } else { 17 | return ""; 18 | } 19 | }; 20 | 21 | export const piecingParam = (param) => { 22 | const typedParam = param.name + ": " + param.type.text; 23 | if ("default" in param) { 24 | return typedParam + " = " + param.default 25 | } 26 | return typedParam; 27 | } -------------------------------------------------------------------------------- /scripts/shared.mjs: -------------------------------------------------------------------------------- 1 | export function getAllComponents(metadata) { 2 | const allComponents = []; 3 | 4 | metadata.modules.map(module => { 5 | module.declarations?.map(declaration => { 6 | if (declaration.customElement) { 7 | const component = declaration; 8 | const modulePath = module.path; 9 | 10 | if (component) { 11 | allComponents.push(Object.assign(component, { modulePath })); 12 | } 13 | } 14 | }); 15 | }); 16 | 17 | return allComponents; 18 | } 19 | 20 | export function getSgdsComponents(allComponents) { 21 | const srcComponents = allComponents.filter(component => component.modulePath.startsWith('src/components')) 22 | return srcComponents 23 | } 24 | 25 | export function pascalToKebab(str) { 26 | return str 27 | .replace(/([A-Z])/g, '-$1') // Insert hyphen before each uppercase letter 28 | .toLowerCase() // Convert the entire string to lowercase 29 | .slice(1); // Remove the leading hyphen if any 30 | } 31 | -------------------------------------------------------------------------------- /sgds-design-alpha-testing.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/sgds-design-alpha-testing.zip -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/src/.DS_Store -------------------------------------------------------------------------------- /src/base/card-element.ts: -------------------------------------------------------------------------------- 1 | import { property } from "lit/decorators.js"; 2 | import cardStyle from "./card.css"; 3 | import textStyles from "../styles/text-variants.css"; 4 | import bgStyles from "../styles/bg-variants.css"; 5 | import borderStyles from "../styles/border-variants.css"; 6 | import headerStyles from "../styles/header-class.css"; 7 | import paragraphStyles from "../styles/paragraph.css"; 8 | 9 | import SgdsElement from "./sgds-element"; 10 | 11 | export class CardElement extends SgdsElement { 12 | static styles = [...SgdsElement.styles, textStyles, bgStyles, borderStyles, headerStyles, paragraphStyles, cardStyle]; 13 | 14 | /** When true, hides the default border of the card. */ 15 | @property({ type: Boolean, reflect: true }) hideBorder = false; 16 | 17 | /** When true, applies a tinted background color to the card. */ 18 | @property({ type: Boolean, reflect: true }) tinted = false; 19 | } 20 | -------------------------------------------------------------------------------- /src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/src/components/.DS_Store -------------------------------------------------------------------------------- /src/components/Accordion/accordion.css: -------------------------------------------------------------------------------- 1 | :host([variant="border"]) .accordion { 2 | border: var(--sgds-border-width-1) solid var(--sgds-border-color-muted); 3 | border-radius: var(--sgds-border-radius-md); 4 | } 5 | -------------------------------------------------------------------------------- /src/components/Accordion/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsAccordion } from "./sgds-accordion"; 2 | import { SgdsAccordionItem } from "./sgds-accordion-item"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-accordion", SgdsAccordion); 6 | register("sgds-accordion-item", SgdsAccordionItem); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-accordion-item": SgdsAccordionItem; 11 | "sgds-accordion": SgdsAccordion; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Alert/alert-link.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: inline-block; 3 | cursor: pointer; 4 | } 5 | 6 | .alert-link, .alert-link:hover { 7 | color: var(--sgds-alert-color); 8 | text-decoration-line: underline; 9 | } 10 | 11 | .alert-link:focus, 12 | .alert-link:focus-visible { 13 | outline: 0; 14 | box-shadow: var(--sgds-box-shadow-focus); 15 | } -------------------------------------------------------------------------------- /src/components/Alert/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsAlert } from "./sgds-alert"; 2 | import { SgdsAlertLink } from "./sgds-alert-link"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-alert", SgdsAlert); 6 | register("sgds-alert-link", SgdsAlertLink); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-alert-link": SgdsAlertLink; 11 | "sgds-alert": SgdsAlert; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Badge/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsBadge } from "./sgds-badge"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-badge", SgdsBadge); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-badge": SgdsBadge; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/breadcrumb-item.css: -------------------------------------------------------------------------------- 1 | :host{ 2 | display: flex; 3 | gap: var(--sgds-gap-xs); 4 | align-items: center; 5 | } 6 | :host([active]) .nav-link::slotted(*) { 7 | --sgds-link-color-default: var(--sgds-color-default); 8 | color: var(--sgds-link-color-default, --sgds-color-default); 9 | pointer-events: none; 10 | } 11 | 12 | :host([active]) .nav-link::slotted(*:hover), 13 | :host([active]) .nav-link::slotted(*:focus), 14 | :host([active]) .nav-link::slotted(*:focus-visible){ 15 | --sgds-link-color-emphasis: var(--sgds-color-default); 16 | color: var(--sgds-link-color-emphasis, --sgds-color-default); 17 | } 18 | 19 | .separator svg { 20 | display: block; 21 | } 22 | 23 | :host(:last-of-type) .separator { 24 | display: none; 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/breadcrumb.css: -------------------------------------------------------------------------------- 1 | .breadcrumb{ 2 | display: flex; 3 | gap: var(--sgds-gap-xs); 4 | } -------------------------------------------------------------------------------- /src/components/Breadcrumb/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsBreadcrumb } from "./sgds-breadcrumb"; 2 | import { SgdsBreadcrumbItem } from "./sgds-breadcrumb-item"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-breadcrumb", SgdsBreadcrumb); 6 | register("sgds-breadcrumb-item", SgdsBreadcrumbItem); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-breadcrumb-item": SgdsBreadcrumbItem; 11 | "sgds-breadcrumb": SgdsBreadcrumb; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Button/button.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: inline-block; 3 | } 4 | 5 | :host([fullWidth]), .btn.full-width { 6 | width: 100%; 7 | } 8 | 9 | .btn.full-width.has-left-icon { 10 | justify-content: flex-start; 11 | } 12 | 13 | .btn.full-width.has-right-icon { 14 | justify-content: space-between; 15 | } 16 | 17 | .btn.full-width.has-left-icon.has-right-icon { 18 | justify-content: center; 19 | } 20 | 21 | .btn span { 22 | padding: 0px var(--sgds-padding-2-xs); 23 | } 24 | -------------------------------------------------------------------------------- /src/components/Button/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsButton } from "./sgds-button"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-button", SgdsButton); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-button": SgdsButton; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Card/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsCard } from "./sgds-card"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-card", SgdsCard); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-card": SgdsCard; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Checkbox/checkbox-group.css: -------------------------------------------------------------------------------- 1 | :host { 2 | --sgds-checkbox-group-gap: var(--sgds-spacer-2); 3 | } 4 | 5 | fieldset { 6 | border: 0; 7 | margin: 0; 8 | min-width: 0; 9 | padding: 0; 10 | display: flex; 11 | flex-direction: column; 12 | gap: var(--sgds-form-gap-md); 13 | } 14 | .label-hint-container { 15 | display: flex; 16 | flex-direction: column; 17 | gap: var(--sgds-form-gap-sm); 18 | } 19 | 20 | .label-hint-container .form-label { 21 | color: var(--sgds-form-color-default); 22 | font-size: var(--sgds-font-size-2); 23 | font-weight: var(--sgds-font-weight-regular); 24 | } 25 | 26 | .checkbox-container { 27 | display: flex; 28 | flex-direction: column; 29 | gap: var(--sgds-form-gap-md); 30 | } 31 | 32 | /* .error-message-container { 33 | display: flex; 34 | gap: var(--sgds-form-gap-sm); 35 | } 36 | 37 | .error-message { 38 | color: var(--sgds-form-danger-color-default); 39 | font-size: var(--sgds-font-size-1); 40 | font-weight: var(--sgds-font-weight-regular); 41 | } */ 42 | -------------------------------------------------------------------------------- /src/components/Checkbox/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsCheckbox } from "./sgds-checkbox"; 2 | import { SgdsCheckboxGroup } from "./sgds-checkbox-group"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-checkbox", SgdsCheckbox); 6 | register("sgds-checkbox-group", SgdsCheckboxGroup); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-checkbox": SgdsCheckbox; 11 | "sgds-checkbox-group": SgdsCheckboxGroup; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/ComboBox/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsComboBox } from "./sgds-combo-box"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-combo-box", SgdsComboBox); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-combo-box": SgdsComboBox; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Datepicker/datepicker-header.css: -------------------------------------------------------------------------------- 1 | .datepicker-header { 2 | display: flex; 3 | gap: var(--sgds-form-gap-md); 4 | } 5 | 6 | sgds-button { 7 | --btn-font-weight: var(--sgds-font-weight-semibold); 8 | } -------------------------------------------------------------------------------- /src/components/Datepicker/datepicker-input.css: -------------------------------------------------------------------------------- 1 | .input-container { 2 | display: flex; 3 | flex-direction: row; 4 | width: -webkit-fill-available; 5 | width: -moz-available; 6 | } 7 | 8 | .form-control-group { 9 | border-right: 0; 10 | } 11 | 12 | .input-feedback { 13 | display: flex; 14 | flex-direction: column; 15 | width: -webkit-fill-available; 16 | width: -moz-available; 17 | } 18 | 19 | .calendar-btn { 20 | all: unset; 21 | 22 | } -------------------------------------------------------------------------------- /src/components/Datepicker/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsDatepicker } from "./sgds-datepicker"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-datepicker", SgdsDatepicker); 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-datepicker": SgdsDatepicker; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/Datepicker/types.ts: -------------------------------------------------------------------------------- 1 | export type ViewEnum = "days" | "months" | "years"; 2 | -------------------------------------------------------------------------------- /src/components/DescriptionList/description-list.css: -------------------------------------------------------------------------------- 1 | :host([bordered][islastchild]) .container:last-child { 2 | border-bottom: none; 3 | } 4 | 5 | :host([stacked]) .container { 6 | flex-direction: column; 7 | justify-content: flex-start; 8 | align-items: flex-start; 9 | gap: var(--sgds-gap-xs); 10 | } 11 | 12 | .container { 13 | display: flex; 14 | justify-content: space-between; 15 | align-items: flex-start; 16 | gap: var(--sgds-gap-xs); 17 | padding: var(--sgds-padding-lg) var(--sgds-padding-xl); 18 | border-bottom: var(--sgds-border-width-1) solid var(--sgds-border-color-muted); 19 | } 20 | 21 | .label-container, 22 | .data-container { 23 | flex: 1; 24 | } 25 | 26 | .label { 27 | color: var(--sgds-color-default); 28 | font-weight: var(--sgds-font-weight-semibold); 29 | font-size: var(--sgds-font-size-2); 30 | } 31 | 32 | .data { 33 | color: var(--sgds-color-subtle); 34 | font-size: var(--sgds-font-size-2); 35 | font-weight: var(--sgds-font-weight-regular); 36 | margin: 0; 37 | } -------------------------------------------------------------------------------- /src/components/DescriptionList/index.ts: -------------------------------------------------------------------------------- 1 | import SgdsDescriptionListGroup from "./sgds-description-list-group"; 2 | import { SgdsDescriptionList } from "./sgds-description-list"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-description-list", SgdsDescriptionList); 6 | register("sgds-description-list-group", SgdsDescriptionListGroup); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-description-list": SgdsDescriptionList; 11 | "sgds-description-list-group": SgdsDescriptionListGroup; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Divider/divider.css: -------------------------------------------------------------------------------- 1 | :host{ 2 | --container-size: 8px; 3 | } 4 | 5 | :host([orientation="horizontal"]) { 6 | width: 100%; 7 | display: block; 8 | margin: calc((var(--container-size) - var(--border-width)) / 2) 0; 9 | border-top: var(--border-width) solid var(--sgds-border-color-muted); 10 | } 11 | 12 | :host([orientation="vertical"]) { 13 | height: 100%; 14 | display: inline-block; 15 | margin: 0 calc((var(--container-size) - var(--border-width)) / 2); 16 | border-left: var(--border-width) solid var(--sgds-border-color-muted); 17 | } 18 | 19 | :host([thickness="thin"]) { 20 | --border-width: var(--sgds-border-width-1); 21 | } 22 | 23 | :host([thickness="thick"]) { 24 | --border-width: var(--sgds-border-width-2); 25 | } 26 | 27 | :host([thickness="thicker"]) { 28 | --border-width: var(--sgds-border-width-4); 29 | } -------------------------------------------------------------------------------- /src/components/Divider/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsDivider } from "./sgds-divider"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-divider", SgdsDivider); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-divider": SgdsDivider; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Drawer/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsDrawer } from "./sgds-drawer"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-drawer", SgdsDrawer); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-drawer": SgdsDrawer; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Dropdown/dropdown.css: -------------------------------------------------------------------------------- 1 | :host { 2 | position: relative; 3 | } 4 | 5 | .dropdown { 6 | display: flex; 7 | height: 100%; 8 | } -------------------------------------------------------------------------------- /src/components/Dropdown/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsDropdown } from "./sgds-dropdown"; 2 | import { SgdsDropdownItem } from "./sgds-dropdown-item"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-dropdown", SgdsDropdown); 6 | register("sgds-dropdown-item", SgdsDropdownItem); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-dropdown": SgdsDropdown; 11 | "sgds-dropdown-item": SgdsDropdownItem; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/FileUpload/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsFileUpload } from "./sgds-file-upload"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-file-upload", SgdsFileUpload); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-file-upload": SgdsFileUpload; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Footer/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsFooter } from "./sgds-footer"; 2 | import { SgdsFooterItem } from "./sgds-footer-item"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-footer", SgdsFooter); 6 | register("sgds-footer-item", SgdsFooterItem); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-footer": SgdsFooter; 11 | "sgds-footer-item": SgdsFooterItem; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Footer/sgds-footer-item.ts: -------------------------------------------------------------------------------- 1 | import { html } from "lit"; 2 | import SgdsElement from "../../base/sgds-element"; 3 | import footerLinkStyle from "./footer-item.css"; 4 | 5 | /** 6 | * @summary The footer item component organizes links under a clear, descriptive title within the footer. It helps users easily navigate to related resources or information, ensuring clarity and accessibility. 7 | * 8 | * @slot default - The slot for the list of link items 9 | * @slot title - The slot for the title of the list of items 10 | * 11 | */ 12 | export class SgdsFooterItem extends SgdsElement { 13 | static styles = [...SgdsElement.styles, footerLinkStyle]; 14 | 15 | render() { 16 | return html` 17 | 23 | `; 24 | } 25 | } 26 | 27 | export default SgdsFooterItem; 28 | -------------------------------------------------------------------------------- /src/components/Icon/icon.css: -------------------------------------------------------------------------------- 1 | :host { 2 | color: inherit; 3 | display: inline-flex; 4 | } 5 | :host([size="sm"]) svg { 6 | width: var(--sgds-icon-size-sm); 7 | height: var(--sgds-icon-size-sm); 8 | } 9 | 10 | :host([size="md"]) svg { 11 | width: var(--sgds-icon-size-md); 12 | height: var(--sgds-icon-size-md); 13 | } 14 | 15 | :host([size="xl"]) svg { 16 | width: var(--sgds-icon-size-xl); 17 | height: var(--sgds-icon-size-xl); 18 | } 19 | 20 | :host([size="2-xl"]) svg { 21 | width: var(--sgds-icon-size-2-xl); 22 | height: var(--sgds-icon-size-2-xl); 23 | } 24 | 25 | :host([size="3-xl"]) svg { 26 | width: var(--sgds-icon-size-3-xl); 27 | height: var(--sgds-icon-size-3-xl); 28 | } 29 | 30 | svg { 31 | display: inline-block; 32 | width: var(--sgds-icon-size-lg); 33 | height: var(--sgds-icon-size-lg); 34 | } -------------------------------------------------------------------------------- /src/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsIcon } from "./sgds-icon"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-icon", SgdsIcon); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-icon": SgdsIcon; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/IconButton/icon-button.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: inline-block; 3 | } 4 | 5 | .btn.btn-icon { 6 | display: flex; 7 | width: var(--sgds-dimension-48, 56px); 8 | height: var(--sgds-dimension-48, 56px); 9 | min-width: unset; 10 | padding: 0; 11 | } 12 | 13 | .btn.btn-icon.btn-lg { 14 | font-size: var(--sgds-font-size-3); 15 | padding: 0; 16 | min-width: unset; 17 | height: var(--sgds-dimension-56); 18 | width: var(--sgds-dimension-56); 19 | } 20 | 21 | .btn.btn-icon.btn-sm { 22 | font-size: var(--sgds-font-size-1); 23 | padding: 0; 24 | min-width: unset; 25 | height: var(--sgds-dimension-40); 26 | width: var(--sgds-dimension-40); 27 | } -------------------------------------------------------------------------------- /src/components/IconButton/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsIconButton } from "./sgds-icon-button"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-icon-button", SgdsIconButton); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-icon-button": SgdsIconButton; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/IconList/icon-list.css: -------------------------------------------------------------------------------- 1 | slot { 2 | display: flex; 3 | flex-direction: column; 4 | gap: var(--sgds-gap-xs); 5 | } 6 | 7 | slot::slotted(*){ 8 | display: flex; 9 | gap: var(--sgds-gap-xs); 10 | align-items: center; 11 | } 12 | 13 | .sm { 14 | font-size: var(--sgds-font-size-1); 15 | } 16 | 17 | .lg { 18 | font-size : var(--sgds-font-size-3) 19 | } -------------------------------------------------------------------------------- /src/components/IconList/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsIconList } from "./sgds-icon-list"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-icon-list", SgdsIconList); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-icon-list": SgdsIconList; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Input/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsInput } from "./sgds-input"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-input", SgdsInput); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-input": SgdsInput; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Link/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsLink } from "./sgds-link"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-link", SgdsLink); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-link": SgdsLink; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Mainnav/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsMainnav } from "./sgds-mainnav"; 2 | import { SgdsMainnavDropdown } from "./sgds-mainnav-dropdown"; 3 | import { SgdsMainnavItem } from "./sgds-mainnav-item"; 4 | import { register } from "../../utils/ce-registry"; 5 | 6 | register("sgds-mainnav", SgdsMainnav); 7 | register("sgds-mainnav-dropdown", SgdsMainnavDropdown); 8 | register("sgds-mainnav-item", SgdsMainnavItem); 9 | declare global { 10 | interface HTMLElementTagNameMap { 11 | "sgds-mainnav": SgdsMainnav; 12 | "sgds-mainnav-dropdown": SgdsMainnavDropdown; 13 | "sgds-mainnav-item": SgdsMainnavItem; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/components/Mainnav/mainnav-context.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from "@lit/context"; 2 | 3 | export const MainnavContext = createContext("mainnav-context"); 4 | -------------------------------------------------------------------------------- /src/components/Masthead/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsMasthead } from "./sgds-masthead"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-masthead", SgdsMasthead); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-masthead": SgdsMasthead; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Modal/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsModal } from "./sgds-modal"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-modal", SgdsModal); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-modal": SgdsModal; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Pagination/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsPagination } from "./sgds-pagination"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-pagination", SgdsPagination); 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-pagination": SgdsPagination; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/ProgressBar/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsProgressBar } from "./sgds-progress-bar"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-progress-bar", SgdsProgressBar); 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-progress-bar": SgdsProgressBar; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/QuantityToggle/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsQuantityToggle } from "./sgds-quantity-toggle"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-quantity-toggle", SgdsQuantityToggle); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-quantity-toggle": SgdsQuantityToggle; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/QuantityToggle/quantity-toggle.css: -------------------------------------------------------------------------------- 1 | .form-control-container { 2 | display: flex; 3 | flex-direction: column; 4 | gap: var(--sgds-form-gap-md); 5 | } 6 | 7 | .input-group { 8 | align-items: stretch; 9 | display: flex; 10 | flex-wrap: wrap; 11 | position: relative; 12 | gap: var(--sgds-form-gap-lg); 13 | } 14 | .input-group > sgds-input { 15 | flex: 1 1 auto; 16 | min-width: 0; 17 | position: relative; 18 | } 19 | .input-group > sgds-input:focus { 20 | z-index: 3; 21 | } 22 | 23 | .input-group sgds-button:focus { 24 | z-index: 3; 25 | } 26 | .visually-hidden { 27 | clip: rect(0, 0, 0, 0) !important; 28 | border: 0 !important; 29 | height: 1px !important; 30 | margin: -1px !important; 31 | overflow: hidden !important; 32 | padding: 0 !important; 33 | position: absolute !important; 34 | white-space: nowrap !important; 35 | width: 1px !important; 36 | } -------------------------------------------------------------------------------- /src/components/Radio/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsRadio } from "./sgds-radio"; 2 | import { SgdsRadioGroup } from "./sgds-radio-group"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-radio", SgdsRadio); 6 | register("sgds-radio-group", SgdsRadioGroup); 7 | 8 | declare global { 9 | interface HTMLElementTagNameMap { 10 | "sgds-radio": SgdsRadio; 11 | "sgds-radio-group": SgdsRadioGroup; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Radio/radio-group.css: -------------------------------------------------------------------------------- 1 | fieldset { 2 | border: 0; 3 | margin: 0; 4 | min-width: 0; 5 | padding: 0; 6 | display: flex; 7 | flex-direction: column; 8 | gap: var(--sgds-form-gap-md); 9 | } 10 | 11 | .label-hint-container { 12 | display: flex; 13 | flex-direction: column; 14 | gap: var(--sgds-form-gap-sm); 15 | } 16 | 17 | .radio-group-validation-input { 18 | display: none; 19 | } 20 | 21 | .radio-container{ 22 | display: flex; 23 | flex-direction: column; 24 | gap: var(--sgds-form-gap-md) 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Sidenav/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsSidenav } from "./sgds-sidenav"; 2 | import { SgdsSidenavItem } from "./sgds-sidenav-item"; 3 | import { SgdsSidenavLink } from "./sgds-sidenav-link"; 4 | import { register } from "../../utils/ce-registry"; 5 | 6 | register("sgds-sidenav", SgdsSidenav); 7 | register("sgds-sidenav-item", SgdsSidenavItem); 8 | register("sgds-sidenav-link", SgdsSidenavLink); 9 | declare global { 10 | interface HTMLElementTagNameMap { 11 | "sgds-sidenav": SgdsSidenav; 12 | "sgds-sidenav-item": SgdsSidenavItem; 13 | "sgds-sidenav-link": SgdsSidenavLink; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/components/Sidenav/sidenav.css: -------------------------------------------------------------------------------- 1 | :host { 2 | --sidenav-sticky-top: 0rem; 3 | padding: var(--sgds-padding-md); 4 | } 5 | 6 | 7 | .sticky { 8 | position: sticky; 9 | top: var(--sidenav-sticky-top); 10 | height: calc(100vh - var(--sidenav-sticky-top)); 11 | overflow-y: visible; 12 | } 13 | -------------------------------------------------------------------------------- /src/components/Skeleton/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsSkeleton } from "./sgds-skeleton"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-skeleton", SgdsSkeleton); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-skeleton": SgdsSkeleton; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Spinner/index.ts: -------------------------------------------------------------------------------- 1 | import { register } from "../../utils/ce-registry"; 2 | import { SgdsSpinner } from "./sgds-spinner"; 3 | 4 | register("sgds-spinner", SgdsSpinner); 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-spinner": SgdsSpinner; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/Stepper/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsStepper } from "./sgds-stepper"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-stepper", SgdsStepper); 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-stepper": SgdsStepper; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/Switch/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsSwitch } from "./sgds-switch"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-switch", SgdsSwitch); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-switch": SgdsSwitch; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Tab/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsTab } from "./sgds-tab"; 2 | import { SgdsTabGroup } from "./sgds-tab-group"; 3 | import { SgdsTabPanel } from "./sgds-tab-panel"; 4 | import { register } from "../../utils/ce-registry"; 5 | 6 | register("sgds-tab", SgdsTab); 7 | register("sgds-tab-group", SgdsTabGroup); 8 | register("sgds-tab-panel", SgdsTabPanel); 9 | 10 | declare global { 11 | interface HTMLElementTagNameMap { 12 | "sgds-tab": SgdsTab; 13 | "sgds-tab-group": SgdsTabGroup; 14 | "sgds-tab-panel": SgdsTabPanel; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/components/Tab/tab-group.css: -------------------------------------------------------------------------------- 1 | .tab-group { 2 | display: flex; 3 | flex-direction: column; 4 | gap: var(--sgds-gap-xl); 5 | } 6 | 7 | .tab-group__nav { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .tab-group__content { 13 | flex: 1; 14 | } 15 | 16 | :host([orientation="vertical"]) .tab-group { 17 | flex-direction: row; 18 | } 19 | 20 | :host([orientation="vertical"]) .tab-group__nav { 21 | flex-direction: column; 22 | } 23 | 24 | :host([variant="solid"]) .tab-group__nav { 25 | gap: var(--sgds-gap-xs); 26 | } -------------------------------------------------------------------------------- /src/components/Tab/tab-panel.css: -------------------------------------------------------------------------------- 1 | .tab-panel { 2 | display: block; 3 | } 4 | 5 | .tab-panel:not(.tab-panel--active) { 6 | display: none; 7 | } -------------------------------------------------------------------------------- /src/components/Table/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsTable } from "./sgds-table"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-table", SgdsTable); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-table": SgdsTable; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/TableOfContents/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsTableOfContents } from "./sgds-table-of-contents"; 2 | 3 | customElements.define("sgds-table-of-contents", SgdsTableOfContents); 4 | 5 | declare global { 6 | interface HTMLElementTagNameMap { 7 | "sgds-table-of-contents": SgdsTableOfContents; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/TableOfContents/sgds-table-of-contents.ts: -------------------------------------------------------------------------------- 1 | import SgdsElement from "../../base/sgds-element"; 2 | import { html } from "lit"; 3 | import tableOfContentsStyle from "./table-of-contents.css"; 4 | 5 | /** 6 | * 7 | * @summary Tables of contents provide a page overview and direct access to specific sections. 8 | * 9 | * @slot default - The slot for the header 10 | * @slot contents - The slot for the contents 11 | */ 12 | 13 | export class SgdsTableOfContents extends SgdsElement { 14 | static styles = [...SgdsElement.styles, tableOfContentsStyle]; 15 | 16 | render() { 17 | return html`
    18 | 19 |
      20 | 21 |
    22 |
    `; 23 | } 24 | } 25 | 26 | export default SgdsTableOfContents; 27 | -------------------------------------------------------------------------------- /src/components/TableOfContents/table-of-contents.css: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | gap: var(--sgds-gap-xl); 5 | } 6 | 7 | slot:not([name])::slotted(*) { 8 | --sgds-font-size-5: var(--sgds-font-size-4); 9 | --sgds-font-size-6: var(--sgds-font-size-4); 10 | --sgds-margin-2-xs: var(--sgds-margin-none); 11 | --sgds-font-weight-bold: var(--sgds-font-weight-semibold); 12 | margin-bottom: var(--sgds-margin-2-xs, var(--sgds-margin-none)); 13 | font-size: var(--sgds-font-size-4); 14 | font-weight: var(--sgds-font-weight-bold, var(--sgds-font-weight-semibold)); 15 | } 16 | 17 | .contents { 18 | display: flex; 19 | flex-direction: column; 20 | gap: var(--sgds-gap-md); 21 | list-style: none; 22 | margin: var(--sgds-margin-none); 23 | padding: var(--sgds-padding-none); 24 | } 25 | 26 | slot[name="contents"]::slotted(li) { 27 | --sgds-margin-3-xs: var(--sgds-margin-none); 28 | margin-top: var(--sgds-margin-3-xs, var(--sgds-margin-none)); 29 | } -------------------------------------------------------------------------------- /src/components/Textarea/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsTextarea } from "./sgds-textarea"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-textarea", SgdsTextarea); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-textarea": SgdsTextarea; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Toast/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsToast } from "./sgds-toast"; 2 | import { SgdsToastContainer } from "./sgds-toast-container"; 3 | import { register } from "../../utils/ce-registry"; 4 | 5 | register("sgds-toast", SgdsToast); 6 | register("sgds-toast-container", SgdsToastContainer); 7 | declare global { 8 | interface HTMLElementTagNameMap { 9 | "sgds-toast-container": SgdsToastContainer; 10 | "sgds-toast": SgdsToast; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/Tooltip/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsTooltip } from "./sgds-tooltip"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-tooltip", SgdsTooltip); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-tooltip": SgdsTooltip; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Tooltip/tooltip.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: contents; 3 | } 4 | .tooltip-placeholder{ 5 | display: inline-block; 6 | } 7 | .tooltip { 8 | word-wrap: break-word; 9 | display: block; 10 | line-break: auto; 11 | opacity: 0; 12 | text-align: left; 13 | text-decoration: none; 14 | text-shadow: none; 15 | text-transform: none; 16 | white-space: normal; 17 | word-break: normal; 18 | word-spacing: normal; 19 | z-index: 1080; 20 | } 21 | 22 | .tooltip.show { 23 | opacity: 1; 24 | } 25 | 26 | .tooltip-inner { 27 | background-color: var(--sgds-surface-fixed-dark); 28 | border-radius: var(--sgds-border-radius-md); 29 | color: var(--sgds-color-fixed-light); 30 | font-size: var(--sgds-font-size-1); 31 | max-width: var(--sgds-dimension-320); 32 | padding: var(--sgds-padding-xs) var(--sgds-padding-sm); 33 | box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.14); 34 | } 35 | 36 | div { 37 | max-width: fit-content; 38 | } 39 | -------------------------------------------------------------------------------- /src/css/sgds.css: -------------------------------------------------------------------------------- 1 | @import "./reboot.css"; 2 | @import "./grid.css"; 3 | -------------------------------------------------------------------------------- /src/internals/CloseButton/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsCloseButton } from "./sgds-close-button"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-close-button", SgdsCloseButton); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-close-button": SgdsCloseButton; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/internals/OverflowMenu/index.ts: -------------------------------------------------------------------------------- 1 | import { SgdsOverflowMenu } from "./sgds-overflow-menu"; 2 | import { register } from "../../utils/ce-registry"; 3 | 4 | register("sgds-overflow-menu", SgdsOverflowMenu); 5 | 6 | declare global { 7 | interface HTMLElementTagNameMap { 8 | "sgds-overflow-menu": SgdsOverflowMenu; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/internals/OverflowMenu/overflow-menu.css: -------------------------------------------------------------------------------- 1 | :host([size="sm"]) .overflow-btn{ 2 | width: var(--sgds-dimension-24); 3 | height: var(--sgds-dimension-24); 4 | } 5 | 6 | .overflow-btn { 7 | width: var(--sgds-dimension-32); 8 | height: var(--sgds-dimension-32); 9 | background-color: var(--sgds-bg-transparent); 10 | border-radius: var(--sgds-border-radius-sm); 11 | border: 0; 12 | padding: 0; 13 | position: relative; 14 | cursor: pointer; 15 | display: flex; 16 | justify-content: center; 17 | align-items: center; 18 | } 19 | 20 | .overflow-btn:hover { 21 | background-color: var(--sgds-bg-translucent-subtle); 22 | } 23 | 24 | .overflow-btn:focus, 25 | .overflow-btn:focus-visible { 26 | outline: 0; 27 | box-shadow: var(--sgds-box-shadow-focus); 28 | background-color: var(--sgds-bg-translucent-subtle); 29 | } -------------------------------------------------------------------------------- /src/styles/bg-variants.css: -------------------------------------------------------------------------------- 1 | .bg-primary { 2 | background-color: var(--sgds-primary) !important; 3 | } 4 | .bg-secondary { 5 | background-color: var(--sgds-secondary) !important; 6 | } 7 | .bg-success { 8 | background-color: var(--sgds-success) !important; 9 | } 10 | .bg-info { 11 | background-color: var(--sgds-info) !important; 12 | } 13 | .bg-warning { 14 | background-color: var(--sgds-warning) !important; 15 | } 16 | .bg-danger { 17 | background-color: var(--sgds-danger)!important; 18 | } 19 | .bg-light { 20 | background-color: var(--sgds-light) !important; 21 | } 22 | .bg-dark { 23 | background-color:var(--sgds-dark) !important; 24 | } 25 | -------------------------------------------------------------------------------- /src/styles/border-variants.css: -------------------------------------------------------------------------------- 1 | .border-primary { 2 | border-color: var(--sgds-primary) !important; 3 | } 4 | .border-secondary { 5 | border-color: var(--sgds-secondary) !important; 6 | } 7 | .border-success { 8 | border-color: var(--sgds-success) !important; 9 | } 10 | .border-info { 11 | border-color: var(--sgds-info) !important; 12 | } 13 | .border-warning { 14 | border-color: var(--sgds-warning) !important; 15 | } 16 | .border-danger { 17 | border-color: var(--sgds-danger) !important; 18 | } 19 | .border-light { 20 | border-color: var(--sgds-light) !important; 21 | } 22 | .border-dark { 23 | border-color: var(--sgds-dark)!important; 24 | } 25 | -------------------------------------------------------------------------------- /src/styles/feedback.css: -------------------------------------------------------------------------------- 1 | .invalid-feedback-container { 2 | display: flex; 3 | gap: var(--sgds-form-gap-sm); 4 | color: var(--sgds-form-danger-color-default); 5 | line-height: var(--sgds-line-height-min); 6 | 7 | } 8 | 9 | .invalid-feedback { 10 | color: var(--sgds-form-danger-color-default); 11 | font-size: var(--sgds-font-size-1); 12 | font-weight: var(--sgds-font-weight-regular); 13 | line-height: var(--sgds-line-height-min); 14 | } 15 | 16 | .valid-icon{ 17 | color: var(--sgds-form-success-color-default); 18 | } 19 | -------------------------------------------------------------------------------- /src/styles/form-check.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GovTechSG/sgds-web-component/a5338d634096973a83083b8378b2782ce9cf6fed/src/styles/form-check.css -------------------------------------------------------------------------------- /src/styles/form-hint.css: -------------------------------------------------------------------------------- 1 | .form-text { 2 | color: var(--sgds-form-color-subtle); 3 | font-size: var(--sgds-font-size-1); 4 | line-height: var(--sgds-line-height-min); 5 | } 6 | 7 | .form-text.disabled { 8 | opacity: var(--sgds-opacity-50); 9 | } -------------------------------------------------------------------------------- /src/styles/form-label.css: -------------------------------------------------------------------------------- 1 | .form-label { 2 | margin-bottom: 0; 3 | color: var(--sgds-form-color-default); 4 | } 5 | 6 | .form-label.disabled { 7 | opacity: var(--sgds-opacity-50); 8 | } 9 | 10 | .form-check-label { 11 | color: var(--sgds-form-color-default); 12 | } 13 | .form-check-input:disabled ~ .form-check-label, 14 | .form-check-input[disabled] ~ .form-check-label { 15 | /* opacity: var(--sgds-disabled-opacity); */ 16 | cursor: not-allowed; 17 | } 18 | -------------------------------------------------------------------------------- /src/styles/form-placeholder.css: -------------------------------------------------------------------------------- 1 | .form-control::placeholder { 2 | color: var(--sgds-form-color-subtle); 3 | font-family: var(--sgds-font-family-brand); 4 | font-weight: var(--sgds-font-weight-light); 5 | line-height: var(--sgds-line-height-body); 6 | } 7 | -------------------------------------------------------------------------------- /src/styles/paragraph.css: -------------------------------------------------------------------------------- 1 | p { 2 | margin-bottom: 1.5rem; 3 | margin-top: 0; 4 | } -------------------------------------------------------------------------------- /src/styles/svg.css: -------------------------------------------------------------------------------- 1 | svg { 2 | vertical-align: middle; 3 | } 4 | -------------------------------------------------------------------------------- /src/styles/text-variants.css: -------------------------------------------------------------------------------- 1 | .text-primary { 2 | color: var(--sgds-primary-rgb) !important; 3 | } 4 | .text-secondary { 5 | color: var(--sgds-secondary-rgb) !important; 6 | } 7 | .text-success { 8 | color: var(--sgds-success-rgb) !important; 9 | } 10 | .text-info { 11 | color: var(--sgds-info-rgb) !important; 12 | } 13 | .text-warning { 14 | color: var(--sgds-warning-rgb) !important; 15 | } 16 | .text-danger { 17 | color: var(--sgds-danger-rgb) !important; 18 | } 19 | .text-light { 20 | color: var(--sgds-light-rgb) !important; 21 | } 22 | .text-dark { 23 | color: var(--sgds-dark-rgb) !important; 24 | } 25 | .text-muted { 26 | color: var(--sgds-secondary-color) !important; 27 | } 28 | -------------------------------------------------------------------------------- /src/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module "bootstrap/js/src/collapse"; 2 | declare module "bootstrap/js/src/dropdown"; 3 | declare module "bootstrap/js/src/tooltip"; 4 | -------------------------------------------------------------------------------- /src/utils/breakpoints.ts: -------------------------------------------------------------------------------- 1 | export const LG_BREAKPOINT = 992; 2 | export const MD_BREAKPOINT = 768; 3 | export const SM_BREAKPOINT = 576; 4 | export const XL_BREAKPOINT = 1200; 5 | export const XXL_BREAKPOINT = 1400; 6 | -------------------------------------------------------------------------------- /src/utils/ce-registry.ts: -------------------------------------------------------------------------------- 1 | import SgdsElement from "../base/sgds-element"; 2 | 3 | /** 4 | * 5 | * @param name tagname of custom element 6 | * @returns boolean 7 | */ 8 | export function isRegistered(name: string): boolean { 9 | return !!customElements.get(name); 10 | } 11 | 12 | export function register(name: string, constructor: typeof SgdsElement) { 13 | if (!customElements.get(name)) { 14 | customElements.define(name, constructor); 15 | } 16 | } 17 | export function warnUnregisteredElements(name: string): boolean { 18 | if (isRegistered(name)) { 19 | return true; 20 | } else { 21 | console.error( 22 | `Custom element of name : ${name} is not registered. Remember to import the component file for custom element registration` 23 | ); 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/utils/event.ts: -------------------------------------------------------------------------------- 1 | /** Waits for a specific event to be emitted from an element. Ignores events that bubble up from child elements. */ 2 | export function waitForEvent(el: HTMLElement, eventName: string) { 3 | return new Promise(resolve => { 4 | function done(event: Event) { 5 | if (event.target === el) { 6 | el.removeEventListener(eventName, done); 7 | resolve(); 8 | } 9 | } 10 | 11 | el.addEventListener(eventName, done); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /src/utils/generateCustomElementName.ts: -------------------------------------------------------------------------------- 1 | const generateCustomElementName = (key: string) => key.replace(/([a-z0–9])([A-Z])/g, "$1-$2").toLowerCase(); 2 | 3 | export default generateCustomElementName; 4 | -------------------------------------------------------------------------------- /src/utils/generateId.ts: -------------------------------------------------------------------------------- 1 | export default function (componentName = "", elementName = ""): string { 2 | return `id-${Math.random().toString().substring(2, 6)}-sgds-${componentName}-${elementName}`; 3 | } 4 | -------------------------------------------------------------------------------- /src/utils/mergeDeep.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | import { assign, keys } from "./object"; 3 | function _isObject(item: any) { 4 | return item && typeof item === "object" && item.constructor === Object; 5 | } 6 | 7 | const mergeDeep = (target: any, source: any) => { 8 | if (_isObject(target) && _isObject(source)) { 9 | keys(source).forEach(key => { 10 | if (_isObject(source[key])) { 11 | if (!target[key] || !_isObject(target[key])) { 12 | target[key] = source[key]; 13 | } 14 | mergeDeep(target[key], source[key]); 15 | } else { 16 | assign(target, { [key]: source[key] }); 17 | } 18 | }); 19 | } 20 | return target; 21 | }; 22 | 23 | export default mergeDeep; 24 | -------------------------------------------------------------------------------- /src/utils/object.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | export const assign = (target: any, ...args: any[]) => Object.assign(target, ...args); 3 | export const keys = (obj: any) => Object.keys(obj); 4 | -------------------------------------------------------------------------------- /src/utils/offset.ts: -------------------------------------------------------------------------------- 1 | export function getOffset(element: HTMLElement, parent: HTMLElement) { 2 | return { 3 | top: Math.round(element.getBoundingClientRect().top - parent.getBoundingClientRect().top), 4 | left: Math.round(element.getBoundingClientRect().left - parent.getBoundingClientRect().left) 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /stories/frameworks/Angular.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Angular from "../../docs/Angular.md?raw"; 3 | 4 | 5 | 6 | {Angular} 7 | -------------------------------------------------------------------------------- /stories/frameworks/Next.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import NextDocs from "../../docs/Next.md?raw"; 3 | 4 | 5 | 6 | {NextDocs} 7 | 8 | -------------------------------------------------------------------------------- /stories/frameworks/React.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import ReactDocs from "../../docs/React.md?raw"; 3 | 4 | 5 | 6 | {ReactDocs} 7 | -------------------------------------------------------------------------------- /stories/frameworks/Vue.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Vue from "../../docs/Vue.md?raw"; 3 | 4 | 5 | 6 | {Vue} 7 | -------------------------------------------------------------------------------- /stories/getting-started/About.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from '@storybook/blocks'; 2 | import WebComponents from '../../docs/WebComponents.md?raw'; 3 | 4 | 5 | 6 | {WebComponents} -------------------------------------------------------------------------------- /stories/getting-started/Imports.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Imports from '../../docs/Imports.md?raw'; 3 | 4 | 5 | 6 | {Imports} 7 | -------------------------------------------------------------------------------- /stories/getting-started/Installation.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Installation from '../../docs/INSTALLATION.md?raw'; 3 | 4 | 5 | 6 | {Installation} 7 | -------------------------------------------------------------------------------- /stories/getting-started/Introduction.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Introduction from '../../docs/Introduction.md?raw'; 3 | 4 | 5 | 6 | {Introduction} 7 | -------------------------------------------------------------------------------- /stories/migration/oneToTwo.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import versionOneToTwo from '../../docs/Migration_v1_to_v2.md?raw'; 3 | 4 | 5 | 6 | {versionOneToTwo} 7 | -------------------------------------------------------------------------------- /stories/migration/twoToThree.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import versionTwoToThree from '../../docs/Migration_v2_to_v3.md?raw'; 3 | 4 | 5 | 6 | {versionTwoToThree} 7 | -------------------------------------------------------------------------------- /stories/patterns.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/blocks"; 2 | 3 | 4 | 5 | # Patterns 6 | -------------------------------------------------------------------------------- /stories/style/GridSystem.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown, Canvas, Story } from "@storybook/blocks"; 2 | import Grid from '../../docs/Grid.md?raw'; 3 | import * as GridStories from "./grid.stories.js" 4 | 5 | 6 | 7 | {Grid} 8 | 9 | ## Basic Grid 10 | 11 | 12 | 13 | 14 | 15 | ## Responsive Grid 16 | 17 | 18 | 19 | 20 | 21 | ## Hidden Columns 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /stories/style/Theming.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import Theming from '../../docs/Theming.md?raw'; 3 | 4 | 5 | 6 | {Theming} -------------------------------------------------------------------------------- /stories/templates.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/blocks"; 2 | 3 | 4 | 5 | # Template 6 | -------------------------------------------------------------------------------- /stories/templates/Accordion/additional.stories.js: -------------------------------------------------------------------------------- 1 | export const BorderVariant = { 2 | render: Template.bind({}), 3 | name: "Border variant", 4 | args: { variant: "border" }, 5 | parameters: {}, 6 | tags: ["!dev"] 7 | }; 8 | 9 | export const DensityVariant = { 10 | render: Template.bind({}), 11 | name: "Compact density", 12 | args: { density: "compact" }, 13 | parameters: {}, 14 | tags: ["!dev"] 15 | }; 16 | 17 | export const AllowMultiple = { 18 | render: Template.bind({}), 19 | name: "Allow multiple active accordion", 20 | args: { allowMultiple: true }, 21 | parameters: {}, 22 | tags: ["!dev"] 23 | }; 24 | 25 | export const Disabled = { 26 | render: Template.bind({}), 27 | name: "Disabled state", 28 | args: { disabled: true }, 29 | parameters: {}, 30 | tags: ["!dev"] 31 | }; 32 | -------------------------------------------------------------------------------- /stories/templates/Alert/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 12 |
    Description with link
    13 |
    14 | `; 15 | export const args = { 16 | href: "#", 17 | show: true, 18 | variant: "info", 19 | title: "Title", 20 | dismissible: true 21 | }; 22 | 23 | export const parameters = {}; 24 | -------------------------------------------------------------------------------- /stories/templates/Badge/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 12 | Badge label 13 | 14 | `; 15 | export const args = {}; 16 | 17 | export const parameters = {}; 18 | -------------------------------------------------------------------------------- /stories/templates/Breadcrumb/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Pass in anchor tags in default slot of `sgds-breadcrumb-item` 2 | 3 | For better SEO, anchor tags are to be passed by the user in the light dom or the slot of `sgds-breadcrumb-item`. 4 | Every `sgds-breadcrumb-item` requires an anchor element. 5 | 6 | ## Overflow menu 7 | 8 | Breadcrumb should show up to 4 breadcrumb items. Beyond that, the breadcrumb component will be re-grouped the excess items and render in a overflow dropdown menu automatically, displaying only the first , second last and last links 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /stories/templates/Breadcrumb/additional.stories.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | const OverflowTemplate = args => { 4 | return html` 5 | 6 | Home 7 | About 8 | Contacts 9 | Link-1 10 | Link-2 11 | Link-3 12 | Link-4 13 | 14 | `; 15 | }; 16 | 17 | export const Overflow = { 18 | render: OverflowTemplate.bind({}), 19 | name: "Overflow", 20 | args: {}, 21 | parameters: { 22 | docs: { 23 | story: { 24 | height: "500px" 25 | } 26 | } 27 | }, 28 | tags: ["!dev"] 29 | }; 30 | -------------------------------------------------------------------------------- /stories/templates/Breadcrumb/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 7 | Home 8 | About 9 | Contacts 10 | 11 | `; 12 | export const args = {}; 13 | 14 | export const parameters = {}; 15 | -------------------------------------------------------------------------------- /stories/templates/Button/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 21 | Button 22 | 23 | `; 24 | export const args = {}; 25 | 26 | export const parameters = {}; 27 | -------------------------------------------------------------------------------- /stories/templates/DescriptionList/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Title and description slots 2 | 3 | Title and description are optional items. They provide more context to the description list as a group 4 | 5 | Use `slot=title` and `slot=description` to pass in title and description 6 | 7 | 8 | 9 | 10 | 11 | 12 | ## Stacked layout 13 | 14 | By default, the layout of description list is inline. Add boolean `stacked` attribute to `SgdsDescriptionListGroup` for a stacked layout 15 | 16 | 17 | 18 | 19 | 20 | 21 | ## Bordered 22 | 23 | By default, there are no borders to the description list. Add `bordered` attribute to `SgdsDescriptionListGroup` for a bordered description list 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /stories/templates/DescriptionList/additional.stories.js: -------------------------------------------------------------------------------- 1 | export const OptionalTitleDescription = { 2 | render: Template.bind({}), 3 | name: "Optional title and description", 4 | args: { title: true, description: true }, 5 | parameters: {}, 6 | tags: ["!dev"] 7 | }; 8 | export const Stacked = { 9 | render: Template.bind({}), 10 | name: "Stacked layout", 11 | args: { stacked: true }, 12 | parameters: {}, 13 | tags: ["!dev"] 14 | }; 15 | export const Bordered = { 16 | render: Template.bind({}), 17 | name: "Bordered", 18 | args: { bordered: true }, 19 | parameters: {}, 20 | tags: ["!dev"] 21 | }; 22 | -------------------------------------------------------------------------------- /stories/templates/Divider/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Vertical orientation 2 | 3 | By default, the divider is of horizontal orientation. 4 | 5 | Change to vertical orientation by setting `orientation="vertical"`. 6 | Ensure that the parent container has a height. 7 | 8 | 9 | 10 | 11 | 12 | ## Thickness 13 | 14 | By default, the divider is of horizontal orientation. 15 | 16 | Change to vertical orientation by setting `orientation="vertical"` 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /stories/templates/Divider/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` `; 8 | 9 | export const args = {}; 10 | 11 | export const parameters = {}; 12 | -------------------------------------------------------------------------------- /stories/templates/Drawer/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Placement 2 | 3 | The drawer supports multiple placement options to control where the drawer appears on the screen. 4 | 5 | By default, the drawer opens from the right (end). You can specify different placements using the placement attribute: 6 | 7 | - `placement="start"`: Opens from the left 8 | - `placement="end"`: Opens from the right 9 | - `placement="top"`: Slides in from the top 10 | - `placement="bottom"`: Slides in from the bottom 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /stories/templates/FileUpload/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 5 | Choose a File 17 | `; 18 | 19 | export const args = {}; 20 | export const parameters = {}; 21 | -------------------------------------------------------------------------------- /stories/templates/Icon/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Sizes 2 | 3 | SgdsIcons offer a variety of sizes : `sm` , `md` , `lg` , `xl` , `2-xl` , `3-xl`. By default, the icon size is `lg` 4 | 5 | 6 | 7 | 8 | 9 | ## Color 10 | 11 | The color of the icons is inherited from its parent container 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /stories/templates/Icon/additional.stories.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | const SizeTemplate = args => { 4 | const sizes = ["sm", "md", "lg", "xl", "2-xl", "3-xl"]; 5 | return html`${sizes.map(s => html` `)} `; 6 | }; 7 | 8 | const ColorTemplate = args => { 9 | const colors = ["red", "blue", "green", "purple", "pink"]; 10 | return html` 11 | ${colors.map( 12 | c => html` 13 | 14 | 15 | 16 | ` 17 | )} 18 | `; 19 | }; 20 | 21 | export const Size = { 22 | render: SizeTemplate.bind({}), 23 | name: "Size", 24 | args: {}, 25 | parameters: {}, 26 | tags: ["!dev"] 27 | }; 28 | 29 | export const Color = { 30 | render: ColorTemplate.bind({}), 31 | name: "Color", 32 | args: {}, 33 | parameters: {}, 34 | tags: ["!dev"] 35 | }; 36 | -------------------------------------------------------------------------------- /stories/templates/IconButton/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` `; 8 | 9 | export const args = { 10 | name: "plus" 11 | }; 12 | 13 | export const parameters = {}; 14 | -------------------------------------------------------------------------------- /stories/templates/IconList/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Sizes 2 | 3 | The default icon list size is medium. Add `size="lg"`,` size="sm"` for additional sizes. 4 | 5 | - `size="sm"`: Reduces the icon and text size. 6 | - Default (`size="md"`): Standard icon and text size, applied when no `size` attribute is specified 7 | - `size="lg"`: Increases both the icon and text size. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /stories/templates/IconList/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | export const Template = args => html` 4 | 5 |
    item 1
    6 |
    item 2
    7 |
    item 3
    8 |
    9 | `; 10 | 11 | export const args = {}; 12 | 13 | export const parameters = {}; 14 | -------------------------------------------------------------------------------- /stories/templates/Link/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Danger variant 2 | 3 | Danger variant for link 4 | 5 | 6 | 7 | 8 | 9 | ## Sizes 10 | 11 | Links are available in `size=sm` `size=md` or `size=lg` 12 | 13 | 14 | 15 | 16 | 17 | ## Icons 18 | 19 | Icons on the right or left of link 20 | 21 | 22 | 23 | 24 | 25 | ## External link 26 | 27 | Adding `target="_blank"` to the anchor tag automatically adds an external link icon 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /stories/templates/Link/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 5 | 6 | Link 7 | 8 | `; 9 | 10 | export const args = {}; 11 | 12 | export const parameters = {}; 13 | -------------------------------------------------------------------------------- /stories/templates/Masthead/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | export const Template = ({ fluid }) => html` `; 4 | 5 | export const args = {}; 6 | 7 | export const parameters = { 8 | layout: "fullscreen" 9 | }; 10 | -------------------------------------------------------------------------------- /stories/templates/Pagination/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = ({ dataLength, currentPage, itemsPerPage, variant, size, navigation }) => { 5 | return html` 6 | 14 | `; 15 | }; 16 | 17 | export const args = { dataLength: "50" }; 18 | export const parameters = {}; 19 | -------------------------------------------------------------------------------- /stories/templates/ProgressBar/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Variants 2 | 3 | There are two variants of progress bar : primary(default) and neutral 4 | 5 | 6 | 7 | 8 | 9 | ## Label 10 | 11 | Add label to the progress bar to provide a textual representation of the progress 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /stories/templates/ProgressBar/additional.stories.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | const VariantTemplate = args => { 4 | return html` 5 |
    6 | 7 | 8 |
    9 | `; 10 | }; 11 | 12 | const LabelTemplate = args => { 13 | return html` 14 |
    15 | 16 | 17 |
    18 | `; 19 | }; 20 | 21 | export const Variants = { 22 | render: VariantTemplate.bind({}), 23 | name: "Variants", 24 | args: {}, 25 | parameters: {}, 26 | tags: ["!dev"] 27 | }; 28 | export const Label = { 29 | render: LabelTemplate.bind({}), 30 | name: "Label", 31 | args: {}, 32 | parameters: {}, 33 | tags: ["!dev"] 34 | }; 35 | -------------------------------------------------------------------------------- /stories/templates/ProgressBar/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 5 | 13 | 14 | `; 15 | 16 | export const args = { 17 | label: "40%", 18 | value: 40, 19 | arialabel: `Loading in progress`, 20 | ariamin: 0, 21 | ariamax: 100 22 | }; 23 | 24 | export const parameters = {}; 25 | -------------------------------------------------------------------------------- /stories/templates/QuantityToggle/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 20 | `; 21 | 22 | export const args = {}; 23 | 24 | export const parameters = {}; 25 | -------------------------------------------------------------------------------- /stories/templates/Skeleton/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Sheen 2 | 3 | Add `sheen` prop to add sheening effect to the skeletons 4 | 5 | 6 | 7 | 8 | 9 | ## Rows 10 | 11 | To skeletonised paragraph text, set a number to `rows` prop. 12 | As the gap between the rows are fixed to `--sgds-gap-xs`, the rows will auto-sized (appear thicker or thinner) depending on the `height` of the skeleton. 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /stories/templates/Skeleton/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 5 |
    6 | 12 | 13 | 14 | 15 |
    16 | `; 17 | 18 | export const args = { 19 | width: "128px", 20 | height: "64px", 21 | borderRadius: "4px" 22 | }; 23 | 24 | export const parameters = {}; 25 | -------------------------------------------------------------------------------- /stories/templates/Spinner/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Variant 2 | 3 | Spinners come in two variants: primary(default) and neutral. 4 | 5 | 6 | 7 | 8 | 9 | ## Size 10 | 11 | There are three sizes of spinners: small, medium(default) and large. 12 | 13 | 14 | 15 | 16 | 17 | ## Label 18 | 19 | Set a label for the spinner with `label` prop of string type. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /stories/templates/Spinner/additional.stories.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | 3 | const VariantTemplate = () => html` 4 | 5 | 6 | `; 7 | const SizeTemplate = () => html` 8 | 9 | 10 | 11 | `; 12 | 13 | export const Variant = { 14 | render: VariantTemplate.bind({}), 15 | name: "Variant", 16 | args: {}, 17 | parameters: {}, 18 | tags: ["!dev"] 19 | }; 20 | export const Size = { 21 | render: SizeTemplate.bind({}), 22 | name: "Size", 23 | args: {}, 24 | parameters: {}, 25 | tags: ["!dev"] 26 | }; 27 | 28 | export const Label = { 29 | render: Template.bind({}), 30 | name: "Label", 31 | args: { label: "Label" }, 32 | parameters: {}, 33 | tags: ["!dev"] 34 | }; 35 | -------------------------------------------------------------------------------- /stories/templates/Spinner/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 | 7 | 8 | `; 9 | 10 | export const args = {}; 11 | 12 | export const parameters = {}; 13 | -------------------------------------------------------------------------------- /stories/templates/Stepper/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = ({ steps, activeStep, clickable, orientation }) => { 5 | return html` 6 | 12 | 13 | `; 14 | }; 15 | 16 | export const args = { 17 | steps: [ 18 | { 19 | stepHeader: "Personal Details", 20 | component: "1 test" 21 | }, 22 | { 23 | stepHeader: "Address and Contact Information", 24 | component: "2 test" 25 | }, 26 | { 27 | stepHeader: "Review", 28 | component: "3 test" 29 | } 30 | ] 31 | }; 32 | 33 | export const parameters = {}; 34 | -------------------------------------------------------------------------------- /stories/templates/Switch/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Sizes 2 | 3 | There are three sizes of switch : small, medium (default), large 4 | 5 | 6 | 7 | 8 | 9 | ## Label 10 | 11 | Add label to provide textual hints on what the switch does. By default label is added to the right of the switch in the default slot. 12 | 13 | Use `slot="leftLabel"` to add label to the left of the switch 14 | 15 | 16 | 17 | 18 | 19 | ## Icon 20 | 21 | Use of on and off icons to provide visual clues of what the switch does. 22 | 23 | Note: The icons are currently fixed and not customisable 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /stories/templates/Switch/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 10 | `; 11 | 12 | export const args = {}; 13 | 14 | export const parameters = {}; 15 | -------------------------------------------------------------------------------- /stories/templates/Table/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Responsive 2 | 3 | Responsive tables allow tables to be scrolled horizontally with ease. 4 | 5 | ## Always Responsive 6 | 7 | Across every breakpoint, use `responsive="always"` for horizontally scrolling tables. Responsive tables are wrapped automatically in a `div`. The following example has 12 columns that are scrollable horizontally. 8 | 9 | 10 | 11 | 12 | 13 | ## Breakpoint Specific 14 | 15 | Use `responsive="sm"`, `responsive="md"` , `responsive="lg"`, or `responsive="xl"` as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /stories/templates/Table/additional.stories.js: -------------------------------------------------------------------------------- 1 | export const AlwaysResponsive = { 2 | render: Template.bind({}), 3 | name: "Always Responsive", 4 | args: { responsive: "always" }, 5 | parameters: {}, 6 | tags: ["!dev"] 7 | }; 8 | export const Responsive = { 9 | render: Template.bind({}), 10 | name: "Responsive", 11 | args: { responsive: "sm" }, 12 | parameters: {}, 13 | tags: ["!dev"] 14 | }; 15 | -------------------------------------------------------------------------------- /stories/templates/Table/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => { 5 | return html` 6 | 15 | 16 | `; 17 | }; 18 | 19 | export const args = {}; 20 | 21 | export const parameters = {}; 22 | -------------------------------------------------------------------------------- /stories/templates/TableOfContents/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Pass in anchor tags to the `contents` slot 2 | 3 | For better SEO, anchor tags are to be passed by the user in the light dom. It is recommended to use `sgds-link` to wrap the anchor tags. 4 | Every `contents` slot requires an anchor element. -------------------------------------------------------------------------------- /stories/templates/TableOfContents/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => html` 5 |

    ${ifDefined(args.title)}

    6 | ${args.contents?.map( 7 | item => 8 | html`
  • 9 | ${item.label} 10 |
  • ` 11 | )} 12 |
    `; 13 | 14 | export const args = { 15 | title: "Table of Contents", 16 | contents: [ 17 | { label: "Introduction", href: "#" }, 18 | { label: "Usage", href: "#" }, 19 | { label: "Examples", href: "#" } 20 | ] 21 | }; 22 | 23 | export const parameters = {}; 24 | -------------------------------------------------------------------------------- /stories/templates/Toast/basic.js: -------------------------------------------------------------------------------- 1 | import { html } from "lit-html"; 2 | import { ifDefined } from "lit/directives/if-defined.js"; 3 | 4 | export const Template = args => 5 | html` 6 |
    7 | 8 | 17 | 18 | This is a toast notifications 19 | Action 20 | 21 | 22 |
    23 | `; 24 | 25 | export const args = { 26 | show: true 27 | }; 28 | 29 | export const parameters = { 30 | docs: {} 31 | }; 32 | -------------------------------------------------------------------------------- /stories/templates/Tooltip/additional.mdx: -------------------------------------------------------------------------------- 1 | ## Placement 2 | 3 | Change `placement` of tooltip relative to its target child 4 | 5 | 6 | 7 | 8 | 9 | ## Trigger 10 | 11 | Change `trigger` of tooltip to invoke the tooltip differently 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /stories/troubleshooting.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import faq from "../docs/FAQ.md?raw"; 3 | 4 | 5 | 6 | {faq} 7 | 8 | -------------------------------------------------------------------------------- /stories/usage/Attributes.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from "@storybook/blocks"; 2 | import AttributeAndProperties from '../../docs/Attributes.md?raw'; 3 | 4 | 5 | 6 | {AttributeAndProperties} 7 | -------------------------------------------------------------------------------- /stories/usage/Events.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from '@storybook/blocks'; 2 | import Events from '../../docs/Events.md?raw'; 3 | 4 | 5 | 6 | {Events} 7 | -------------------------------------------------------------------------------- /stories/usage/Extendable.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from '@storybook/blocks'; 2 | import Extendable from '../../docs/Extendable.md?raw'; 3 | 4 | 5 | 6 | {Extendable} -------------------------------------------------------------------------------- /stories/usage/Slots.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown } from '@storybook/blocks'; 2 | import Slots from '../../docs/Slots.md?raw'; 3 | 4 | 5 | 6 | {Slots} 7 | -------------------------------------------------------------------------------- /test/divider.test.ts: -------------------------------------------------------------------------------- 1 | import { html } from "lit"; 2 | import { expect, fixture } from "@open-wc/testing"; 3 | import { SgdsDivider } from "../src/components"; 4 | import "../src/index"; 5 | 6 | describe("", () => { 7 | it("has the default attributes", async () => { 8 | const el = await fixture(html``); 9 | expect(el.getAttribute("role")).to.equal("separator"); 10 | expect(el.getAttribute("aria-orientation")).to.equal("horizontal"); 11 | expect(el.getAttribute("thickness")).to.equal("thin"); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /test/generateId.test.ts: -------------------------------------------------------------------------------- 1 | import generateId from "../src/utils/generateId"; 2 | import { expect } from "@open-wc/testing"; 3 | import sinon from "sinon"; 4 | 5 | describe("generateId function", () => { 6 | sinon.stub(Math, "random").returns(1234567); 7 | 8 | it("returns a string", () => { 9 | expect(typeof generateId()).to.equal("string"); 10 | }); 11 | it("returns an id with the correct structure", () => { 12 | expect(generateId()).to.equal("id-3456-sgds--"); 13 | }); 14 | 15 | it("when suffix specified , should return with suffix", () => { 16 | expect(generateId("test", "test")).to.equal("id-3456-sgds-test-test"); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /test/index.test.ts: -------------------------------------------------------------------------------- 1 | import "./sgds-web-component"; 2 | 3 | import * as Components from "../src/components"; 4 | import { assert } from "@open-wc/testing"; 5 | 6 | const tagNameConverter = (key: string) => key.replace(/([a-z0–9])([A-Z])/g, "$1-$2").toLowerCase(); 7 | 8 | describe("custom element registration is correct", () => { 9 | for (const [key, value] of Object.entries(Components)) { 10 | const customElementTag = tagNameConverter(key); 11 | it("is defined", () => { 12 | const el = document.createElement(customElementTag); 13 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 14 | assert.instanceOf(el, value as any); 15 | }); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /test/link.test.ts: -------------------------------------------------------------------------------- 1 | import { assert, fixture } from "@open-wc/testing"; 2 | import { html } from "lit"; 3 | import { SgdsLink } from "../src/components"; 4 | import "../src/index"; 5 | 6 | describe("", () => { 7 | it("can be semantically compare with shadowDom trees", async () => { 8 | const el = await fixture(html``); 9 | assert.shadowDom.equal( 10 | el, 11 | ` 12 | 13 | ` 14 | ); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /test/overflow-menu.test.ts: -------------------------------------------------------------------------------- 1 | import { assert, fixture } from "@open-wc/testing"; 2 | import { html } from "lit"; 3 | import "../src/internals/OverflowMenu"; 4 | 5 | describe("", () => { 6 | it("semantically matches the DOM", async () => { 7 | const el = await fixture(html``); 8 | assert.shadowDom.equal( 9 | el, 10 | ` 11 | 12 | 15 | 16 | 17 | ` 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /test/progress.test.ts: -------------------------------------------------------------------------------- 1 | import "./sgds-web-component"; 2 | import { html } from "lit"; 3 | import { fixture, assert } from "@open-wc/testing"; 4 | import type { SgdsProgressBar } from "../src/components"; 5 | 6 | describe("", () => { 7 | it("renders with default values", async () => { 8 | const el = await fixture(html` `); 9 | assert.shadowDom.equal( 10 | el, 11 | `
    12 |
    13 |
    22 |
    23 |
    ` 24 | ); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /test/sgds-web-component.ts: -------------------------------------------------------------------------------- 1 | import "../src/index"; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "lib": ["es2017", "dom", "dom.iterable"], 7 | "declaration": true, 8 | "declarationDir": "lib", 9 | "sourceMap": true, 10 | "experimentalDecorators": true, 11 | "inlineSources": true, 12 | "skipLibCheck": true, 13 | "noImplicitAny": false, 14 | "importHelpers": true, 15 | "rootDir": "src", 16 | "allowJs": true, 17 | "typeRoots": ["./src/typings", "./node_modules/@types"] 18 | }, 19 | "include": ["**/*.ts", "typings"], 20 | "exclude": ["node_modules", "lib", "test", "test-outdir", "mocks", "react", "cypress", "cypress.config.ts"] 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "allowSyntheticDefaultImports": true, 5 | "rootDir": "." 6 | }, 7 | "include": ["**/*.ts", "./mocks/*.ts"], 8 | "exclude": ["node_modules", "lib", "src", "cypress", "cypress.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /typings/css.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.css" { 2 | import { CSSResult } from "lit"; 3 | const styles: CSSResult; 4 | export default styles; 5 | } 6 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig, createLogger } from "vite"; 2 | import postcssLit from "rollup-plugin-postcss-lit"; 3 | import replace from "@rollup/plugin-replace"; 4 | 5 | const logger = createLogger(); 6 | const originalWarning = logger.warn; 7 | logger.warn = (msg, options) => { 8 | if (msg.includes("Default and named imports from CSS files are deprecated")) return; 9 | originalWarning(msg, options); 10 | }; 11 | 12 | export default defineConfig({ 13 | plugins: [ 14 | replace({ 15 | ".css": ".css?inline", 16 | preventAssignment: true 17 | }), 18 | postcssLit({ include: ["**/*.css", "**/*.css?*"] }) 19 | ], 20 | resolve: { 21 | alias: [ 22 | { 23 | // this is required for the SCSS modules 24 | find: /^~(.*)$/, 25 | replacement: "$1" 26 | } 27 | ] 28 | }, 29 | define: { 30 | "process.env.VITE_ENV": JSON.stringify(process.env.VITE_ENV) 31 | }, 32 | customLogger: logger, 33 | build: { 34 | cssCodeSplit: false 35 | } 36 | }); 37 | --------------------------------------------------------------------------------