@govtechsg/sgds-web-component 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +571 -41
  2. package/base/card-element.d.ts +4 -4
  3. package/base/dropdown-element.d.ts +29 -8
  4. package/base/link-element.d.ts +8 -0
  5. package/components/Accordion/index.d.ts +2 -2
  6. package/components/Accordion/sgds-accordion-item.d.ts +8 -4
  7. package/components/Accordion/sgds-accordion.d.ts +4 -2
  8. package/components/ActionCard/index.d.ts +1 -1
  9. package/components/ActionCard/sgds-action-card.d.ts +38 -10
  10. package/components/Alert/index.d.ts +1 -1
  11. package/components/Badge/index.d.ts +1 -1
  12. package/components/Button/index.d.ts +1 -1
  13. package/components/Button/sgds-button.d.ts +16 -10
  14. package/components/Card/index.d.ts +1 -0
  15. package/components/Card/sgds-card.d.ts +24 -0
  16. package/components/Checkbox/index.d.ts +1 -1
  17. package/components/Checkbox/sgds-checkbox.d.ts +26 -7
  18. package/components/Dropdown/index.d.ts +2 -3
  19. package/components/Dropdown/sgds-dropdown-item.d.ts +6 -2
  20. package/components/Dropdown/sgds-dropdown.d.ts +19 -0
  21. package/components/FileUpload/index.d.ts +1 -1
  22. package/components/FileUpload/sgds-file-upload.d.ts +44 -0
  23. package/components/Footer/index.d.ts +1 -1
  24. package/components/Footer/sgds-footer.d.ts +35 -1
  25. package/components/Input/index.d.ts +1 -1
  26. package/components/Input/sgds-input.d.ts +46 -13
  27. package/components/Mainnav/index.d.ts +3 -3
  28. package/components/Mainnav/sgds-mainnav-dropdown.d.ts +4 -0
  29. package/components/Mainnav/sgds-mainnav-item.d.ts +5 -1
  30. package/components/Mainnav/sgds-mainnav.d.ts +20 -5
  31. package/components/Masthead/index.d.ts +1 -1
  32. package/components/Masthead/sgds-masthead.d.ts +17 -0
  33. package/components/Modal/index.d.ts +1 -1
  34. package/components/Modal/sgds-modal.d.ts +45 -0
  35. package/components/QuantityToggle/index.d.ts +1 -1
  36. package/components/QuantityToggle/sgds-quantity-toggle.d.ts +39 -14
  37. package/components/Radio/index.d.ts +2 -2
  38. package/components/Radio/sgds-radio-group.d.ts +27 -12
  39. package/components/Radio/sgds-radio.d.ts +12 -3
  40. package/components/Sidenav/index.d.ts +3 -3
  41. package/components/Sidenav/sgds-sidenav-item.d.ts +27 -6
  42. package/components/Sidenav/sgds-sidenav-link.d.ts +6 -1
  43. package/components/Sidenav/sgds-sidenav.d.ts +8 -1
  44. package/components/Spinner/index.d.ts +1 -0
  45. package/components/Spinner/sgds-spinner.d.ts +11 -0
  46. package/components/Stepper/sgds-stepper.d.ts +31 -7
  47. package/components/Tab/index.d.ts +3 -3
  48. package/components/Table/sgds-table.d.ts +54 -3
  49. package/components/Textarea/index.d.ts +1 -1
  50. package/components/Textarea/sgds-textarea.d.ts +44 -15
  51. package/components/Toast/index.d.ts +1 -1
  52. package/components/Tooltip/index.d.ts +1 -1
  53. package/index.d.ts +2 -0
  54. package/index.js +1331 -824
  55. package/index.js.map +1 -1
  56. package/main.d.ts +1 -0
  57. package/package.json +1 -1
  58. package/react/action-card/index.d.ts +3 -1
  59. package/react/{fileupload → card}/index.d.ts +1 -1
  60. package/react/checkbox/index.d.ts +3 -1
  61. package/react/cjs/index.js +1521 -949
  62. package/react/cjs/index.js.map +1 -1
  63. package/react/dropdown/index.d.ts +6 -1
  64. package/react/file-upload/index.d.ts +5 -0
  65. package/react/index.d.ts +4 -2
  66. package/react/index.js +1493 -923
  67. package/react/index.js.map +1 -1
  68. package/react/input/index.d.ts +6 -1
  69. package/react/mainnav-dropdown/index.d.ts +6 -1
  70. package/react/modal/index.d.ts +7 -1
  71. package/react/quantity-toggle/index.d.ts +4 -1
  72. package/react/radio/index.d.ts +4 -1
  73. package/react/radio-group/index.d.ts +3 -1
  74. package/react/spinner/index.d.ts +3 -0
  75. package/react/stepper/index.d.ts +8 -1
  76. package/react/textarea/index.d.ts +6 -1
  77. package/umd/index.js +1280 -844
  78. package/umd/index.js.map +1 -1
  79. package/utils/form.d.ts +16 -0
  80. package/components/FileUpload/sgds-fileupload.d.ts +0 -22
@@ -1,22 +1,37 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
2
  export type MainnavExpandSize = "sm" | "md" | "lg" | "xl" | "xxl" | "always" | "never";
3
3
  /**
4
- * @slot - Pass in SgdsMainnavItem elements here.
4
+ * @summary This component is the primary means that your users will use to navigate through your portal. It includes horizontal navigation and branding to identify your site.
5
+ *
6
+ * @slot - Default slot of SgdsMainnav. Pass in SgdsMainnavItem elements here.
5
7
  * @slot end - Elements in this slot will be positioned to the right end of .navbar-nav. Elements in this slot will also be included in collapsed menu.
8
+ * @slot brand - Brand slot of SgdsMainnav. Pass in brand logo img here
9
+ * @slot non-collapsible - Elements in this slot will not be collapsed
10
+ *
11
+ * @cssproperty --mainnav-background-color - Navbar's background color.
12
+ * @cssproperty --mainnav-padding-x - left and right padding for browser width > 768px
13
+ * @cssproperty --mainnav-padding-y - top and bottom padding for browser width > 768px
14
+ * @cssproperty --mainnav-mobile-padding-x - left and right padding for browser width < 768px
15
+ * @cssproperty --mainnav-mobile-padding-y - top and bottom padding for browser width < 768px
16
+ * @cssproperty --mainnav-borderBottom-width - bottom border width
17
+ * @cssproperty --mainnav-borderBottom-color - borderBottom width color
6
18
  */
7
19
  export declare class SgdsMainnav extends SgdsElement {
8
20
  static styles: import("lit").CSSResultGroup[];
9
21
  constructor();
22
+ /** @internal */
10
23
  private myCollapse;
24
+ /** @internal */
11
25
  private bsCollapse;
12
- private myOffcanvas;
13
- private bsOffcanvas;
14
26
  private _onClickButton;
27
+ /** The href link for brand logo */
15
28
  brandHref: string;
16
- collapseId: string;
29
+ private collapseId;
30
+ /** The breakpoint, below which, the Navbar will collapse. When always the Navbar will always be expanded regardless of screen size. When never, the Navbar will always be collapsed */
17
31
  expand: MainnavExpandSize;
18
- mode: "offcanvas" | "default";
32
+ /** @internal */
19
33
  breakpointReached: boolean;
34
+ /** @internal */
20
35
  expanded: boolean;
21
36
  firstUpdated(): void;
22
37
  _handleSlotChange(e: Event): void;
@@ -1 +1 @@
1
- export * from "./sgds-masthead";
1
+ export { SgdsMasthead } from "./sgds-masthead";
@@ -1,8 +1,25 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
+ /**
3
+ * @summary All .gov.sg digital services shall adopt The Official Government Banner for every page in the digital service and be placed at the top of the page.
4
+ *
5
+ * @cssproperty --masthead-font-family - Sets font family for masthead
6
+ * @cssproperty --masthead-text-color - Sets overall text color
7
+ * @cssproperty --masthead-link-color - Sets link color for `How to identify?` and `Trusted Site`
8
+ * @cssproperty --masthead-link-color-hover - Sets link hover color for `How to identify?` and `Trusted Site`
9
+ * @cssproperty --masthead-mobile-font-size - Sets the padding left and right for viewport width 1024px and below
10
+ * @cssproperty --masthead-mobile-padding-x - Sets the font size for viewport width 1024px and below
11
+ * @cssproperty --masthead-fluid-padding-x - Sets the container-fluid padding left and right for viewport width 1024px and above
12
+ * @cssproperty --masthead-crest-color - Sets the lion head crest color.
13
+ */
2
14
  export declare class SgdsMasthead extends SgdsElement {
3
15
  static styles: import("lit").CSSResultGroup[];
16
+ /**
17
+ * Sets the masthead container width to 100% for all breakpoints
18
+ */
4
19
  fluid: boolean;
20
+ /** @internal */
5
21
  toggleVisibility: boolean;
22
+ /** @internal */
6
23
  private _toggleVisibility;
7
24
  render(): import("lit").TemplateResult<1>;
8
25
  }
@@ -1 +1 @@
1
- export * from "./sgds-modal";
1
+ export { SgdsModal } from "./sgds-modal";
@@ -1,16 +1,61 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
+ /**
3
+ * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.
4
+ *
5
+ * @slot default - The content of the Modal's body.
6
+ * @slot footer - The content of the Modal's footer, typically used to pass in buttons for call to action.
7
+ *
8
+ * @event sgds-close - Emitted when the modal is called to close via mouseclick of close button, overlay or via keyboard esc key
9
+ * @event sgds-show - Emitted when the modal opens
10
+ * @event sgds-hide - Emitted when the modal closes
11
+ * @event sgds-after-show - Emitted after modal opens and the animations has completed
12
+ * @event sgds-after-hide - Emitted after modal closes and the animations has completed
13
+ *
14
+ * @csspart base - The component's base wrapper
15
+ * @csspart overlay - The overlay that covers the screen behind the dialog
16
+ * @csspart panel - The modal's dialog panel
17
+ * @csspart header - The modal's header (h3 element) that wraps the title, titleIcon and close button
18
+ * @csspart title - The div element wrapping title and titleIcon
19
+ * @csspart body - The modal's body where the content lies
20
+ * @csspart footers - The modal's footer
21
+ *
22
+ * @cssproperty --modal-padding - The general modal padding of modal component. Applied to body, footer and header.
23
+ * @cssproperty --modal-panel-z-index - The z-index of modal panel
24
+ * @cssproperty --modal-panel-width - The width of modal panel.
25
+ * @cssproperty --modal-panel-height - The height of modal panel.
26
+ * @cssproperty --modal-panel-background-color - The background color of modal panel
27
+ * @cssproperty --modal-panel-border-radius - The border radius of modal panel
28
+ * @cssproperty --modal-header-bottom-border-line-width - The line width of header's bottom border
29
+ * @cssproperty --modal-overlay-background-color - The overlay's background color
30
+ */
2
31
  export declare class SgdsModal extends SgdsElement {
3
32
  static styles: import("lit").CSSResultGroup[];
33
+ /**@internal */
4
34
  dialog: HTMLElement;
35
+ /**@internal */
5
36
  panel: HTMLElement;
37
+ /**@internal */
6
38
  overlay: HTMLElement;
39
+ /**@internal */
7
40
  private readonly hasSlotController;
41
+ /**@internal */
8
42
  private modal;
43
+ /**@internal */
9
44
  private originalTrigger;
45
+ /**Indicates whether or not the modal is open. You can use this in lieu of the show/hide methods. */
10
46
  open: boolean;
47
+ /**The modal's title as displayed in the header */
11
48
  title: string;
49
+ /**The modal's icon as displayed in the header. Pass in SVG format icons as string directly */
12
50
  titleIcon: string;
51
+ /** Disables the header. This will also remove the default close button */
13
52
  noHeader: boolean;
53
+ /** Centers the modal vertically in page */
54
+ centered: boolean;
55
+ /** Centers the contents inside the modal */
56
+ centeredAlignVariant: boolean;
57
+ /** Removes the default animation when opening and closing of modal */
58
+ noAnimation: boolean;
14
59
  connectedCallback(): void;
15
60
  firstUpdated(): void;
16
61
  disconnectedCallback(): void;
@@ -1 +1 @@
1
- export * from "./sgds-quantity-toggle";
1
+ export { SgdsQuantityToggle } from "./sgds-quantity-toggle";
@@ -1,28 +1,53 @@
1
- import { SgdsButton } from "../Button";
1
+ import { ButtonVariant } from "../Button";
2
2
  import SgdsElement from "../../base/sgds-element";
3
- export declare class SgdsQuantityToggle extends SgdsElement {
4
- input: HTMLInputElement;
5
- leftBtn: SgdsButton;
6
- lastBtn: SgdsButton;
3
+ import { SgdsFormControl } from "../../utils/form";
4
+ /**
5
+ * @summary The quantity toggle component is used to increase or decrease an incremental venue, best used when the user needs to enter or adjust the quantity of a selected item.
6
+ *
7
+ * @csspart base - The base wrapper of the quantity toggle component.
8
+ * @csspart button - The plus and minus button of quantity toggle
9
+ *
10
+ * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.
11
+ * @event sgds-input - Emitted when the control receives input and its value changes.
12
+ *
13
+ */
14
+ export declare class SgdsQuantityToggle extends SgdsElement implements SgdsFormControl {
15
+ /**@internal */
16
+ private input;
17
+ /**@internal */
18
+ private plusBtn;
19
+ /**@internal */
20
+ private minusBtn;
7
21
  static styles: import("lit").CSSResultGroup[];
8
- quantToggleId: string;
22
+ /**@internal */
23
+ private readonly formSubmitController;
24
+ /** The name of the input */
9
25
  name: string;
10
26
  /** The input's minimum value. */
11
- min: number | string;
27
+ min: number;
12
28
  /** The input's maximum value. */
13
- max: number | string;
14
- size: "sm" | "lg" | "default";
15
- count: number;
29
+ max: number;
30
+ /**Controls the size of the quantity toggle */
31
+ size: "sm" | "lg";
32
+ /**The input's value. Set to 0 by default */
33
+ value: number;
34
+ /** Disables the entire quantity toggle */
16
35
  disabled: boolean;
17
- quantityToggleClasses?: string;
36
+ /** The quantity toggle's button variants */
37
+ buttonVariant: ButtonVariant;
18
38
  /**
19
- * Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is
20
- * implied, allowing any numeric value.
39
+ * Controls the incremental / decremental value of the input
21
40
  */
22
41
  step: number;
23
42
  /** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
24
- defaultValue: string;
43
+ defaultValue: number;
44
+ /** @internal The id forwarded to input element */
45
+ private inputId;
25
46
  handleChange(event: string): void;
47
+ /** Simulates a click on the plus button */
48
+ plus(): void;
49
+ /** Simulates a click on the minus button */
50
+ minus(): void;
26
51
  onPlus(event: MouseEvent): void;
27
52
  onMinus(event: MouseEvent): void;
28
53
  render(): import("lit").TemplateResult;
@@ -1,2 +1,2 @@
1
- export * from "./sgds-radio";
2
- export * from "./sgds-radio-group";
1
+ export { SgdsRadio } from "./sgds-radio";
2
+ export { SgdsRadioGroup } from "./sgds-radio-group";
@@ -1,41 +1,56 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
2
  import { FormSubmitController } from "../../utils/form";
3
+ /**
4
+ * @summary RadioGroup group multiple radios so they function as a single form control.
5
+ *
6
+ * @slot default - The default slot where sgds-radio are placed.
7
+ *
8
+ * @event sgds-change - Emitted when the radio group's selected value changes.
9
+ */
3
10
  export declare class SgdsRadioGroup extends SgdsElement {
4
11
  static styles: import("lit").CSSResultGroup[];
12
+ /**@internal */
5
13
  protected readonly formSubmitController: FormSubmitController;
14
+ /**@internal */
6
15
  defaultSlot: HTMLSlotElement;
16
+ /**@internal */
7
17
  input: HTMLInputElement;
8
- private defaultValue;
18
+ /**@internal */
19
+ defaultValue: string;
20
+ /**@internal */
9
21
  private customErrorMessage;
10
- /**
11
- * The radio group label. Required for proper accessibility. If you need to display HTML, you can use the `label` slot
12
- * instead.
13
- */
14
- label: string;
22
+ /** @internal This will be true when the control is in an invalid state. */
23
+ invalid: boolean;
15
24
  /** The selected value of the control. */
16
25
  value: string;
17
26
  /** The name assigned to the radio controls. */
18
27
  name: string;
19
28
  /** Ensures a child radio is checked before allowing the containing form to submit. */
20
29
  required: boolean;
21
- /**
22
- * This will be true when the control is in an invalid state.
23
- */
24
- invalid: boolean;
30
+ /**Feedback text for error state when validated */
25
31
  invalidFeedback: string;
32
+ /** Allows invalidFeedback, invalid and valid styles to be visible with the input */
33
+ hasFeedback: boolean;
26
34
  handleValueChange(): void;
27
35
  connectedCallback(): void;
36
+ /** Gets and return the ValidityState object. */
28
37
  get validity(): ValidityState;
29
38
  /** Checks for validity and shows the browser's validation message if the control is invalid. */
30
39
  reportValidity(): boolean;
31
- private getAllRadios;
40
+ /**@internal */
41
+ private _radios;
32
42
  handleRadioClick(event: MouseEvent): void;
33
43
  handleKeyDown(event: KeyboardEvent): void;
34
44
  handleLabelClick(): void;
35
45
  handleSlotChange(): void;
36
- handleInvalid(): void;
46
+ handleInvalid(e: Event): void;
37
47
  showNativeErrorMessage(): void;
38
48
  updateCheckedRadio(): void;
39
49
  render(): import("lit").TemplateResult<1>;
40
50
  }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "sgds-radio-group": SgdsRadioGroup;
54
+ }
55
+ }
41
56
  export default SgdsRadioGroup;
@@ -1,18 +1,27 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
+ /**
3
+ * @summary Radio allows the user to select one option from a set while seeing all available options.
4
+ *
5
+ * @slot default - The label of the radio button
6
+ *
7
+ * @event sgds-focus - Emitted when the control gains focus.
8
+ * @event sgds-blur - Emitted when the control loses focus.
9
+ */
2
10
  export declare class SgdsRadio extends SgdsElement {
3
11
  static styles: import("lit").CSSResultGroup[];
12
+ /**
13
+ * Draws the radio in a checked state
14
+ */
4
15
  checked: boolean;
5
- protected hasFocus: boolean;
6
16
  /** The radio's value attribute. */
7
17
  value: string;
8
- /** For id/for pair of the HTML form control. */
9
- radioId: string;
10
18
  /** Disables the radio. */
11
19
  disabled: boolean;
12
20
  /** Aligns the radios horizontally */
13
21
  isInline: boolean;
14
22
  /** For aria-label */
15
23
  ariaLabel: string;
24
+ private radioId;
16
25
  connectedCallback(): void;
17
26
  handleCheckedChange(): void;
18
27
  handleDisabledChange(): void;
@@ -1,3 +1,3 @@
1
- export * from "./sgds-sidenav";
2
- export * from "./sgds-sidenav-item";
3
- export * from "./sgds-sidenav-link";
1
+ export { SgdsSidenav } from "./sgds-sidenav";
2
+ export { SgdsSidenavItem } from "./sgds-sidenav-item";
3
+ export { SgdsSidenavLink } from "./sgds-sidenav-link";
@@ -5,29 +5,50 @@ import SgdsElement from "../../base/sgds-element";
5
5
  *
6
6
  * @slot - default slot for SgdsSidenavLink element.
7
7
  * @slot title - title slot for the content of SgdsSidenavItem's button / anchor element.
8
+ * @slot icon - icon slot for the content of SgdsSidenavItem's button / anchor element.
9
+ *
10
+ * @cssproperty --sidenav-item-button-border-left-width - sidenav item left border width
11
+ * @cssproperty --sidenav-item-padding-x - sidenav item padding left and right
12
+ * @cssproperty --sidenav-item-padding-y - sidenav item padding top and bottom
13
+ * @cssproperty --sidenav-item-icon-title-gap - the flex gap between sidenav item icon and title
8
14
  */
9
15
  export declare class SgdsSidenavItem extends SgdsElement {
10
16
  static styles: import("lit").CSSResultGroup[];
17
+ /** @internal */
11
18
  private myCollapse;
19
+ /** @internal */
12
20
  private bsCollapse;
13
- /** when true, toggles the sidenav-item to open on first load and
14
- * set the active stylings.
21
+ /**
22
+ * when true, toggles the sidenav-item to open on first load and set the active stylings.
15
23
  */
16
24
  active: boolean;
25
+ /**
26
+ * When defined, converts SgdsSidenavItem from a button element to an Anchor element. In this case, only one level of navigation is allowed
27
+ */
17
28
  href: string;
18
- collapseId: string;
19
- buttonId: string;
29
+ /**
30
+ * Disables the SgdsSidenavItem
31
+ */
20
32
  disabled: boolean;
33
+ /**
34
+ * @internal Forwards to id attribute of div.collapse and aria-controls attribute of button in SgdsSidenavItem. By default, SgdsSidenavItem auto-generates a unique id. Override the default id by specifiying your own
35
+ */
36
+ private collapseId;
37
+ /**
38
+ * @internal Forwards to id attribute of button and aria-labelledby attribute of ul.sidenav-list in SgdsSidenavItem. By default, SgdsSidenavItem auto-generates a unique id. Override the default id by specifiying your own
39
+ */
40
+ private buttonId;
41
+ /** @internal */
21
42
  private index;
22
43
  private _onClick;
23
44
  private _onClickButton;
24
45
  private _onClickLink;
25
46
  /**
26
- * closeItem - closes sidenav and inactivates it
47
+ * When invoked, closes the SgdsSidenavItem
27
48
  */
28
49
  closeItem(): void;
29
50
  /**
30
- * openItem
51
+ * When invoked, opens the SgdsSidenavItem
31
52
  */
32
53
  openItem(): void;
33
54
  firstUpdated(): void;
@@ -1,6 +1,11 @@
1
1
  import LinkElement from "../../base/link-element";
2
2
  /**
3
- * @slot - default slot for label of anchor tag.
3
+ * @slot default - slot for label of anchor tag.
4
+ *
5
+ * @cssproperty --sidenav-link-font-size - sidenav link font size, default to `--sgds-body-font-size`
6
+ * @cssproperty --sidenav-link-padding-x - sidenav link padding left and right
7
+ * @cssproperty --sidenav-link-padding-y - sidenav link padding top and bottom
8
+ * @cssproperty --sidenav-link-disabled-color - sidenav link disabled color, default to `--sgds-gray-600`
4
9
  */
5
10
  export declare class SgdsSidenavLink extends LinkElement {
6
11
  static styles: import("lit").CSSResultGroup;
@@ -1,9 +1,16 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
2
  /**
3
- * @slot - default slot for SgdsSidenavItem element.
3
+ * @summary The side navigation is used to display a list of links to move between pages within a related category.
4
+ * It is used as a secondary form of navigation where the primary navigation is located hierachically above the page frame.
5
+ * Maximum two levels of navigations are allowed.
6
+ *
7
+ * @slot default - Default slot for SgdsSidenavItem element.
8
+ *
9
+ * @cssproperty --sidenav-theme-color - overall sidenav theme color
4
10
  */
5
11
  export declare class SgdsSidenav extends SgdsElement {
6
12
  static styles: import("lit").CSSResultGroup;
13
+ /** Allow sidenav items to stay open when another item is opened */
7
14
  alwaysOpen: boolean;
8
15
  render(): import("lit").TemplateResult<1>;
9
16
  }
@@ -0,0 +1 @@
1
+ export { SgdsSpinner, Type } from "./sgds-spinner";
@@ -0,0 +1,11 @@
1
+ import SgdsElement from "../../base/sgds-element";
2
+ export type Type = "border" | "grow";
3
+ export type Color = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
4
+ export declare class SgdsSpinner extends SgdsElement {
5
+ static styles: import("lit").CSSResultGroup[];
6
+ type: Type;
7
+ color: Color;
8
+ spinnerClasses?: string;
9
+ render(): import("lit").TemplateResult;
10
+ }
11
+ export default SgdsSpinner;
@@ -1,17 +1,41 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
+ /**
3
+ * @summary Steppers are used to inform users which step they are at in a form or a process
4
+ * @slot step-n - The slot for content in each step. "n" refers to numeral value starting from 1. e.g. step-1, step-2, step-3 etc.
5
+ *
6
+ * @event sgds-next-step - Emitted right before the next step is reached. Event is fired when nextStep method is called.
7
+ * @event sgds-previous-step - Emitted right before the previous step is reached. Event is fired when previousStep method is called.
8
+ * @event sgds-last-step - Emitted right before the last step is reached. Event is fired when lastStep method is called.
9
+ * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.
10
+ * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived and its slot are rendered.
11
+ * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
12
+ *
13
+ */
2
14
  export declare class SgdsStepper extends SgdsElement {
3
15
  static styles: import("lit").CSSResultGroup[];
4
- steps: {
5
- title: number;
6
- stepHeader: string;
7
- }[];
16
+ /** The header name for steps in chronological order
17
+ */
18
+ steps: string[];
19
+ /** The current state of active step. Defaults to 0 */
8
20
  activeStep: number;
9
- connectedCallback(): void;
10
- incrementStep(): void;
11
- decrementStep(): void;
21
+ /**Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
22
+ defaultActiveStep: number;
23
+ /** Moves the active step forward one step */
24
+ nextStep(): void;
25
+ /** Moves the active step back one step */
26
+ previousStep(): void;
27
+ /** Changes the active step to the last step */
12
28
  lastStep(): void;
29
+ /** Changes active step to the first step */
13
30
  firstStep(): void;
31
+ /** Resets the Stepper to its initial active step state */
32
+ reset(): void;
33
+ /**@internal */
14
34
  _onStepperItemClick(index: number): void;
35
+ /**@internal */
36
+ _handleActiveStepChange(): void;
37
+ /**@internal */
38
+ _handleKeyDown(event: KeyboardEvent, index: number): void;
15
39
  render(): import("lit").TemplateResult<1>;
16
40
  }
17
41
  export default SgdsStepper;
@@ -1,3 +1,3 @@
1
- export * from "./sgds-tab";
2
- export * from "./sgds-tabpanel";
3
- export * from "./sgds-tabgroup";
1
+ export { SgdsTab } from "./sgds-tab";
2
+ export { SgdsTabPanel } from "./sgds-tabpanel";
3
+ export { SgdsTabGroup } from "./sgds-tabgroup";
@@ -1,22 +1,73 @@
1
1
  import SgdsElement from "../../base/sgds-element";
2
+ /**
3
+ * @summary The use of a table is to organise a collections of data into readable rows
4
+ *
5
+ * @cssproperty --sgds-table-bg - Table's background color
6
+ * @cssproperty --sgds-table-accent-bg - Table's accent background color
7
+ * @cssproperty --sgds-table-striped-color - Text color for striped table
8
+ * @cssproperty --sgds-table-striped-bg - Background color for striped table
9
+ * @cssproperty --sgds-table-active-color - Active text color for hovered row
10
+ * @cssproperty --sgds-table-active-bg - Active background color for hovered row
11
+ * @cssproperty --sgds-table-hover-color - Hovered text color for hover table
12
+ * @cssproperty --sgds-table-hover-bg - Hovered background color for hover table
13
+ */
2
14
  export declare class SgdsTable extends SgdsElement {
3
15
  static styles: import("lit").CSSResultGroup[];
16
+ /**
17
+ * Adds zebra-striping using striped to table row within the <tbody>
18
+ */
4
19
  striped: boolean;
20
+ /**
21
+ * Add borders to all sides of table and cells
22
+ */
5
23
  bordered: boolean;
24
+ /**
25
+ * Remove all borders to table and cells
26
+ */
6
27
  borderless: boolean;
28
+ /**
29
+ * Add hoverable state on table rows
30
+ */
7
31
  hover: boolean;
8
- size?: string;
9
- variant?: string;
32
+ /**
33
+ * Add <code>.table-sm</code> to make table more compact
34
+ */
35
+ size: string;
36
+ /**
37
+ * Use contextual classes to add colors to table
38
+ */
39
+ variant: string;
40
+ /**
41
+ * Sorting on a column is enabled by adding the sort property. The sorting algorithm is based on javascript array.sort() method. In ascending order from bottom, alphabets come first, followed by numbers, and then symbols. Similarly, in descending order from bottom, symbols come first, followed by numbers, and then alphabets.
42
+ */
10
43
  sort: boolean;
44
+ /**
45
+ * When removableSort is present, the third click removes the sorting from the column.
46
+ */
11
47
  removableSort: boolean;
12
- responsive?: "sm" | "md" | "lg" | "xl";
48
+ /**
49
+ * 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. Use reponsive="always" to let table be always responsive
50
+ */
51
+ responsive: "sm" | "md" | "lg" | "xl" | "always";
52
+ /**
53
+ * Populate header cells using Arrays
54
+ */
13
55
  tableHeaders: any[];
56
+ /**
57
+ * Populate data cells using Arrays
58
+ */
14
59
  tableData: any[];
60
+ /** @internal */
15
61
  sortColumn: number | null;
62
+ /** @internal */
16
63
  sortAsc: boolean;
64
+ /** @internal */
17
65
  activeColumn: number | null;
66
+ /** @internal */
18
67
  sortClickCount: number;
68
+ /** @internal */
19
69
  clickCount: number;
70
+ /** @internal */
20
71
  originalTableData: Array<string[]>;
21
72
  connectedCallback(): void;
22
73
  handleHeaderClick(columnIndex: number): void;
@@ -1 +1 @@
1
- export * from "./sgds-textarea";
1
+ export { SgdsTextarea } from "./sgds-textarea";