@govtechsg/sgds-web-component 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/dropdown-element.d.ts +24 -0
- package/base/link-element.d.ts +6 -0
- package/components/Accordion/sgds-accordion-item.d.ts +8 -4
- package/components/Accordion/sgds-accordion.d.ts +4 -2
- package/components/Button/sgds-button.d.ts +16 -10
- package/components/Checkbox/sgds-checkbox.d.ts +25 -6
- package/components/Footer/sgds-footer.d.ts +35 -1
- package/components/Input/sgds-input.d.ts +45 -12
- package/components/Mainnav/sgds-mainnav-item.d.ts +5 -1
- package/components/Mainnav/sgds-mainnav.d.ts +20 -4
- package/components/Masthead/sgds-masthead.d.ts +17 -0
- package/components/Radio/sgds-radio-group.d.ts +27 -12
- package/components/Radio/sgds-radio.d.ts +10 -2
- package/components/Sidenav/sgds-sidenav-item.d.ts +25 -4
- package/components/Sidenav/sgds-sidenav-link.d.ts +5 -0
- package/components/Sidenav/sgds-sidenav.d.ts +4 -0
- package/components/Spinner/index.d.ts +1 -0
- package/components/Spinner/sgds-spinner.d.ts +11 -0
- package/components/Table/sgds-table.d.ts +54 -3
- package/components/Textarea/sgds-textarea.d.ts +43 -14
- package/index.d.ts +1 -0
- package/index.js +581 -336
- package/index.js.map +1 -1
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/react/checkbox/index.d.ts +3 -1
- package/react/cjs/index.js +715 -434
- package/react/cjs/index.js.map +1 -1
- package/react/dropdown/index.d.ts +6 -1
- package/react/index.d.ts +2 -1
- package/react/index.js +688 -408
- package/react/index.js.map +1 -1
- package/react/input/index.d.ts +6 -1
- package/react/mainnav-dropdown/index.d.ts +6 -1
- package/react/radio/index.d.ts +4 -1
- package/react/radio-group/index.d.ts +3 -1
- package/react/spinner/index.d.ts +3 -0
- package/react/textarea/index.d.ts +6 -1
- package/umd/index.js +580 -335
- package/umd/index.js.map +1 -1
- package/utils/form.d.ts +16 -0
|
@@ -6,26 +6,50 @@ import { SgdsDropdownItem } from "../components/Dropdown/sgds-dropdown-item";
|
|
|
6
6
|
import SgdsElement from "./sgds-element";
|
|
7
7
|
export type DropdownButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
8
8
|
export type DropDirection = "left" | "right" | "up" | "down";
|
|
9
|
+
/**
|
|
10
|
+
* @event sgds-show - Emitted event when show instance is called
|
|
11
|
+
* @event sgds-shown - Emitted event when dropdown has been made visible to the user and CSS transitions have completed
|
|
12
|
+
* @event sgds-hide - Emitted event when hide instance is called
|
|
13
|
+
* @event sgds-hidden - Emitted event when dropdown has hidden to the user and CSS transitions have completed
|
|
14
|
+
*/
|
|
9
15
|
export declare class DropdownElement extends SgdsElement {
|
|
10
16
|
static styles: import("lit").CSSResultGroup;
|
|
17
|
+
/** @internal */
|
|
11
18
|
myDropdown: Ref<HTMLElement>;
|
|
19
|
+
/** @internal */
|
|
12
20
|
bsDropdown: Dropdown;
|
|
21
|
+
/** Controls auto-flipping of menu */
|
|
13
22
|
noFlip: boolean;
|
|
23
|
+
/** When true, aligns right edge of menu with right edge of button */
|
|
14
24
|
menuAlignRight: boolean;
|
|
25
|
+
/** The drop position of menu relative to the toggle button */
|
|
15
26
|
drop: DropDirection;
|
|
27
|
+
/** Additional configuration to pass to Popper.js. See https://popper.js.org/ for config opts */
|
|
16
28
|
popperOpts: {};
|
|
29
|
+
/** Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */
|
|
17
30
|
togglerId: string;
|
|
31
|
+
/** Sets the text content of Dropdown button */
|
|
18
32
|
togglerText: string;
|
|
33
|
+
/** Sets color of Dropdown button */
|
|
19
34
|
variant: DropdownButtonVariant;
|
|
35
|
+
/** When true, dropdown menu shows on first load */
|
|
20
36
|
menuIsOpen: boolean;
|
|
37
|
+
/** Controls the close behaviour of dropdown menu. By default menu auto-closes when SgdsDropdownItem or area outside dropdown is clicked */
|
|
21
38
|
close: "outside" | "default" | "inside";
|
|
39
|
+
/** Disables the dropdown toggle */
|
|
22
40
|
disabled: boolean;
|
|
41
|
+
/** @internal */
|
|
23
42
|
nextDropdownItemNo: number;
|
|
43
|
+
/** @internal */
|
|
24
44
|
prevDropdownItemNo: number;
|
|
45
|
+
/** @internal */
|
|
25
46
|
dropdownConfig: Partial<Popper.Options>;
|
|
47
|
+
/** @internal */
|
|
26
48
|
modifierOpt: StrictModifiers[];
|
|
27
49
|
firstUpdated(): void;
|
|
50
|
+
/** When invoked, opens the dropdown menu */
|
|
28
51
|
showMenu(): void;
|
|
52
|
+
/** When invoked, hides the dropdown menu */
|
|
29
53
|
hideMenu(): void;
|
|
30
54
|
_onClickButton(): void;
|
|
31
55
|
_resetMenu(): void;
|
package/base/link-element.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import SgdsElement from "./sgds-element";
|
|
2
|
+
/**
|
|
3
|
+
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
4
|
+
*/
|
|
2
5
|
export default class LinkElement extends SgdsElement {
|
|
3
6
|
static styles: import("lit").CSSResultGroup;
|
|
7
|
+
/** when true, sets the active stylings of .nav-link */
|
|
4
8
|
active: boolean;
|
|
9
|
+
/** Href attribute for anchor element in SgdsMainnavItem */
|
|
5
10
|
href: string;
|
|
11
|
+
/** Disables the SgdsMainnavItem */
|
|
6
12
|
disabled: boolean;
|
|
7
13
|
render(): import("lit").TemplateResult<1>;
|
|
8
14
|
}
|
|
@@ -10,6 +10,12 @@ import SgdsElement from "../../base/sgds-element";
|
|
|
10
10
|
* @csspart base - The accordion-item base wrapper
|
|
11
11
|
* @csspart header - The accordion-item button header
|
|
12
12
|
* @csspart content - The accordion-item content
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --accordion-item-padding-y - The top and bottom padding for the container of accordion item's content
|
|
15
|
+
* @cssprop --accordion-item-padding-x - The right and left padding for the container of accordion item's content
|
|
16
|
+
* @cssprop --accordion-item-border-radius - The border radius of the accordion item
|
|
17
|
+
* @cssprop --accordion-item-font-weight - The font weight of accordion-button when it is not collapsed
|
|
18
|
+
* @cssprop --accordion-item-line-height - The line height of accordion
|
|
13
19
|
*/
|
|
14
20
|
export declare class SgdsAccordionItem extends SgdsElement {
|
|
15
21
|
static styles: import("lit").CSSResultGroup[];
|
|
@@ -21,12 +27,10 @@ export declare class SgdsAccordionItem extends SgdsElement {
|
|
|
21
27
|
body: HTMLElement;
|
|
22
28
|
/** Controls whether accordion-item is open or close */
|
|
23
29
|
open: boolean;
|
|
24
|
-
/**
|
|
30
|
+
/** The summary to show in the header of the accordion */
|
|
25
31
|
summary: string;
|
|
26
|
-
/** Disables the accordion-item. When true, accordion-item cannot open */
|
|
27
|
-
disabled: boolean;
|
|
28
32
|
/** Optional for accordion item. Can be used to insert any utility classes such as `me-auto` */
|
|
29
|
-
accordionItemClasses
|
|
33
|
+
accordionItemClasses: string;
|
|
30
34
|
firstUpdated(): void;
|
|
31
35
|
private handleSummaryClick;
|
|
32
36
|
private handleSummaryKeyDown;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
import type SgdsAccordionItem from "./sgds-accordion-item";
|
|
3
3
|
/**
|
|
4
|
-
* @summary A dropdown mechanism that allow users to either show or hide related content.
|
|
4
|
+
* @summary A dropdown mechanism that allow users to either show or hide related content. `SgdsAccordion` is a wrapper to manage the behaviour for multiple `SgdsAccordionItems`
|
|
5
5
|
* @slot default - slot for accordion-item
|
|
6
6
|
*/
|
|
7
7
|
export declare class SgdsAccordion extends SgdsElement {
|
|
8
8
|
static styles: import("lit").CSSResultGroup[];
|
|
9
|
+
/** Allows multiple accordion items to be opened at the same time */
|
|
9
10
|
allowMultiple: boolean;
|
|
10
|
-
|
|
11
|
+
/** Optional for accordion wrapper. Can be used to insert any utility classes such as me-auto */
|
|
12
|
+
accordionClasses: string;
|
|
11
13
|
/** @internal */
|
|
12
14
|
private defaultNodes;
|
|
13
15
|
/** @internal */
|
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
export type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-danger" | "outline-warning" | "outline-info" | "outline-light" | "outline-dark";
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @summary Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
|
|
5
|
+
*
|
|
6
|
+
* @slot default - The button's label.
|
|
5
7
|
*
|
|
6
8
|
* @event sgds-blur - Emitted when the button is not focused.
|
|
7
9
|
* @event sgds-focus - Emitted when the button is focused.
|
|
8
10
|
*/
|
|
9
11
|
export declare class SgdsButton extends SgdsElement {
|
|
10
12
|
static styles: import("lit").CSSResultGroup[];
|
|
13
|
+
/** @internal */
|
|
11
14
|
button: HTMLButtonElement | HTMLLinkElement;
|
|
15
|
+
/** @internal */
|
|
12
16
|
private readonly formSubmitController;
|
|
13
|
-
|
|
14
|
-
/** The button's variant. */
|
|
17
|
+
/** One or more button variant combinations buttons may be one of a variety of visual variants such as: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `dark`, `light`, `link` as well as "outline" versions (prefixed by `outline-*`) */
|
|
15
18
|
variant: ButtonVariant;
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/** Optional for button. Can be used to insert any utility classes such as me-auto **/
|
|
20
|
+
buttonClasses: string;
|
|
21
|
+
/** Specifies a large or small button */
|
|
18
22
|
size: "sm" | "lg";
|
|
19
|
-
/**
|
|
23
|
+
/** Manually set the visual state of the button to `:active` */
|
|
20
24
|
active: boolean;
|
|
21
|
-
/**
|
|
25
|
+
/** The disabled state of the button */
|
|
22
26
|
disabled: boolean;
|
|
27
|
+
/** The behavior of the button with default as `type='button', `reset` resets all the controls to their initial values and `submit` submits the form data to the server */
|
|
23
28
|
type: "button" | "submit" | "reset";
|
|
24
29
|
/** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */
|
|
25
|
-
href
|
|
30
|
+
href: string;
|
|
26
31
|
/** Tells the browser where to open the link. Only used when `href` is set. */
|
|
27
|
-
target
|
|
32
|
+
target: "_blank" | "_parent" | "_self" | "_top";
|
|
28
33
|
/** Tells the browser to download the linked file as this filename. Only used when `href` is set. */
|
|
29
|
-
download
|
|
34
|
+
download: string;
|
|
30
35
|
/**
|
|
31
36
|
* The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The
|
|
32
37
|
* value of this attribute must be an id of a form in the same document or shadow root as the button.
|
|
@@ -49,6 +54,7 @@ export declare class SgdsButton extends SgdsElement {
|
|
|
49
54
|
handleBlur(): void;
|
|
50
55
|
handleFocus(): void;
|
|
51
56
|
handleClick(event: MouseEvent): void;
|
|
57
|
+
/** @internal */
|
|
52
58
|
clickHandler: () => void;
|
|
53
59
|
render(): import("lit").TemplateResult;
|
|
54
60
|
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
|
|
2
|
+
import { SgdsFormControl } from "../../utils/form";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Checkbox component is used when you require users to select multiple items from a list.
|
|
5
|
+
*
|
|
6
|
+
* @slot default - The label of checkbox.
|
|
7
|
+
*
|
|
8
|
+
* @event sgds-change - Emitted when the radio group's selected value changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SgdsCheckbox extends SgdsElement implements SgdsFormControl {
|
|
3
11
|
static styles: import("lit").CSSResultGroup[];
|
|
12
|
+
/**@internal */
|
|
4
13
|
input: HTMLInputElement;
|
|
14
|
+
/**@internal */
|
|
5
15
|
private readonly formSubmitController;
|
|
6
16
|
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
7
17
|
name: string;
|
|
8
|
-
/** For Id/For pair of the HTML form control. */
|
|
18
|
+
/** For Id/For pair of the HTML form control and label. */
|
|
9
19
|
checkboxId: string;
|
|
10
20
|
/** For aria-label when there is no appropriate text label visible */
|
|
11
21
|
ariaLabel: string;
|
|
12
|
-
/** Manually style the input as valid */
|
|
13
|
-
valid: boolean;
|
|
14
|
-
/** Manually style the input as invalid */
|
|
15
|
-
invalid: boolean;
|
|
16
22
|
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
17
23
|
value: string;
|
|
18
24
|
/** Makes the checkbox a required field. */
|
|
@@ -21,14 +27,27 @@ export declare class SgdsCheckbox extends SgdsElement {
|
|
|
21
27
|
checked: boolean;
|
|
22
28
|
/** Disables the checkbox (so the user can't check / uncheck it). */
|
|
23
29
|
disabled: boolean;
|
|
30
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
31
|
+
hasFeedback: boolean;
|
|
32
|
+
/**Feedback text for error state when validated */
|
|
33
|
+
invalidFeedback?: string;
|
|
24
34
|
/** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
|
|
25
35
|
defaultChecked: boolean;
|
|
36
|
+
/** @internal */
|
|
37
|
+
valid: boolean;
|
|
38
|
+
/** @internal */
|
|
39
|
+
invalid: boolean;
|
|
26
40
|
/** Simulates a click on the checkbox. */
|
|
27
41
|
click(): void;
|
|
42
|
+
/** Sets focus on the checkbox. */
|
|
43
|
+
focus(options?: FocusOptions): void;
|
|
44
|
+
/** Removes focus from the checkbox. */
|
|
45
|
+
blur(): void;
|
|
28
46
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
29
47
|
reportValidity(): boolean;
|
|
30
48
|
handleChange(): void;
|
|
31
49
|
handleKeyDown(event: KeyboardEvent): void;
|
|
50
|
+
handleInvalid(e: Event): void;
|
|
32
51
|
handleDisabledChange(): void;
|
|
33
52
|
handleStateChange(): void;
|
|
34
53
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -8,19 +8,53 @@ export interface ColumnLinks {
|
|
|
8
8
|
links: Links[];
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
+
* @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.
|
|
12
|
+
*
|
|
11
13
|
* @csspart footer-top - The component's footer-top section container.
|
|
12
14
|
* @csspart footer-bottom - The component's footer-bottom section container.
|
|
15
|
+
*
|
|
16
|
+
* @cssproperty footer-top - The component's footer-top section container.
|
|
17
|
+
* @cssproperty footer-bottom - The component's footer-bottom section container.
|
|
13
18
|
*/
|
|
14
19
|
export declare class SgdsFooter extends SgdsElement {
|
|
15
20
|
static styles: import("lit").CSSResultGroup[];
|
|
21
|
+
/**
|
|
22
|
+
* Sets title of SgdsFooter
|
|
23
|
+
*/
|
|
16
24
|
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* Sets description of SgdsFooter
|
|
27
|
+
*/
|
|
17
28
|
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* Sets copyrightLiner of SgdsFooter
|
|
31
|
+
*/
|
|
32
|
+
copyrightLiner: string;
|
|
33
|
+
/**
|
|
34
|
+
* Array of type
|
|
35
|
+
*
|
|
36
|
+
* `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`
|
|
37
|
+
*/
|
|
18
38
|
links: ColumnLinks[];
|
|
39
|
+
/**
|
|
40
|
+
* String date for last updated date
|
|
41
|
+
*/
|
|
19
42
|
lastUpdatedDate: string;
|
|
43
|
+
/**
|
|
44
|
+
* href link for contacts
|
|
45
|
+
*/
|
|
20
46
|
contactHref: string;
|
|
47
|
+
/**
|
|
48
|
+
* href link for feedback
|
|
49
|
+
*/
|
|
21
50
|
feedbackHref: string;
|
|
22
|
-
|
|
51
|
+
/**
|
|
52
|
+
* href link for privacy statement
|
|
53
|
+
*/
|
|
23
54
|
privacyHref: string;
|
|
55
|
+
/**
|
|
56
|
+
* href link for terms of use
|
|
57
|
+
*/
|
|
24
58
|
termsOfUseHref: string;
|
|
25
59
|
render(): import("lit").TemplateResult<1>;
|
|
26
60
|
}
|
|
@@ -1,33 +1,66 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
|
|
2
|
+
import type { SgdsFormControl } from "../../utils/form";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Text inputs allow your users to enter letters, numbers and symbols on a single line.
|
|
5
|
+
*
|
|
6
|
+
* @event sgds-change - Emitted when an alteration to the control's value is committed by the user.
|
|
7
|
+
* @event sgds-input - Emitted when the control receives input and its value changes.
|
|
8
|
+
* @event sgds-focus - Emitted when input is in focus.
|
|
9
|
+
* @event sgds-blur - Emitted when input is not in focus.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare class SgdsInput extends SgdsElement implements SgdsFormControl {
|
|
13
|
+
static styles: import("lit").CSSResultGroup;
|
|
14
|
+
/**@internal */
|
|
3
15
|
input: HTMLInputElement;
|
|
4
|
-
|
|
16
|
+
/**@internal */
|
|
5
17
|
private readonly formSubmitController;
|
|
6
|
-
|
|
18
|
+
/** The type of input which works the same as HTMLInputElement*/
|
|
7
19
|
type: "date" | "datetime-local" | "email" | "number" | "password" | "search" | "tel" | "text" | "time" | "url";
|
|
20
|
+
/** The input's label */
|
|
8
21
|
label: string;
|
|
22
|
+
/** The input's hint text below the label */
|
|
9
23
|
hintText: string;
|
|
24
|
+
/**The input's id. This value gets forwarded into the HTMLInputElement of the component. Defaults to a unique value */
|
|
10
25
|
inputId: string;
|
|
26
|
+
/**The input's name attribute */
|
|
11
27
|
name: string;
|
|
28
|
+
/**Forwards classes to the native HTMLInputElement of the component. Can be used to insert any classes from bootstrap such as mt-2 */
|
|
12
29
|
inputClasses: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
30
|
+
/**Optional. Pass svg html of icons in string form*/
|
|
31
|
+
icon: string;
|
|
32
|
+
/**Sets the minimum length of the input */
|
|
33
|
+
minlength: number;
|
|
34
|
+
/**Sets the maximum length of the input */
|
|
35
|
+
maxlength: number;
|
|
36
|
+
/**The input's placeholder text. */
|
|
17
37
|
placeholder: string;
|
|
18
|
-
pattern
|
|
19
|
-
|
|
38
|
+
/**A pattern to validate input against. */
|
|
39
|
+
pattern: string;
|
|
40
|
+
/**Autofocus the input */
|
|
20
41
|
autofocus: boolean;
|
|
42
|
+
/**Disables the input. */
|
|
21
43
|
disabled: boolean;
|
|
44
|
+
/**Makes the input a required field. */
|
|
22
45
|
required: boolean;
|
|
23
|
-
/**
|
|
46
|
+
/**Makes the input readonly. */
|
|
24
47
|
readonly: boolean;
|
|
48
|
+
/**The input's value attribute. */
|
|
49
|
+
value: string;
|
|
50
|
+
/**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. */
|
|
51
|
+
defaultValue: string;
|
|
52
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
53
|
+
hasFeedback: boolean;
|
|
54
|
+
/**Feedback text for error state when validated */
|
|
55
|
+
invalidFeedback: string;
|
|
56
|
+
/**@internal */
|
|
25
57
|
invalid: boolean;
|
|
58
|
+
/**@internal */
|
|
26
59
|
valid: boolean;
|
|
27
|
-
/** 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. */
|
|
28
|
-
defaultValue: string;
|
|
29
60
|
/** Sets focus on the input. */
|
|
30
61
|
focus(options?: FocusOptions): void;
|
|
62
|
+
/** Sets blur on the input. */
|
|
63
|
+
blur(): void;
|
|
31
64
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
32
65
|
reportValidity(): boolean;
|
|
33
66
|
handleInvalid(): void;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import LinkElement from "../../base/link-element";
|
|
2
2
|
/**
|
|
3
|
-
* @slot -
|
|
3
|
+
* @slot default - slot for SgdsMainnavItem element.
|
|
4
|
+
*
|
|
5
|
+
* @cssproperty --mainnav-item-theme-color - Hover and active color for mainnav items.
|
|
6
|
+
* @cssproperty --mainnav-item-color - Text color of nav item.
|
|
7
|
+
* @cssproperty --mainnav-item-borderBottom-width - border bottom width for hover and active state for nav item
|
|
4
8
|
*/
|
|
5
9
|
export declare class SgdsMainnavItem extends LinkElement {
|
|
6
10
|
static styles: import("lit").CSSResultGroup[];
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
export type MainnavExpandSize = "sm" | "md" | "lg" | "xl" | "xxl" | "always" | "never";
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
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;
|
|
29
|
+
/** Forwards to id attribute of div.collapse and aria-controls attribute of toggler button in SgdsMainnav. By default, SgdsMainnav auto-generates a unique id. Override the default id by specifiying your own */
|
|
16
30
|
collapseId: string;
|
|
31
|
+
/** 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
32
|
expand: MainnavExpandSize;
|
|
18
|
-
|
|
33
|
+
/** @internal */
|
|
19
34
|
breakpointReached: boolean;
|
|
35
|
+
/** @internal */
|
|
20
36
|
expanded: boolean;
|
|
21
37
|
firstUpdated(): void;
|
|
22
38
|
_handleSlotChange(e: Event): void;
|
|
@@ -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,30 +1,40 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
import { FormSubmitController } from "../../utils/form";
|
|
3
|
-
|
|
3
|
+
import { SgdsFormControl } from "../../utils/form";
|
|
4
|
+
/**
|
|
5
|
+
* @summary RadioGroup group multiple radios so they function as a single form control.
|
|
6
|
+
*
|
|
7
|
+
* @slot default - The default slot where sgds-radio are placed.
|
|
8
|
+
*
|
|
9
|
+
* @event sgds-change - Emitted when the radio group's selected value changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SgdsRadioGroup extends SgdsElement implements SgdsFormControl {
|
|
4
12
|
static styles: import("lit").CSSResultGroup[];
|
|
13
|
+
/**@internal */
|
|
5
14
|
protected readonly formSubmitController: FormSubmitController;
|
|
15
|
+
/**@internal */
|
|
6
16
|
defaultSlot: HTMLSlotElement;
|
|
17
|
+
/**@internal */
|
|
7
18
|
input: HTMLInputElement;
|
|
8
|
-
|
|
19
|
+
/**@internal */
|
|
20
|
+
defaultValue: string;
|
|
21
|
+
/**@internal */
|
|
9
22
|
private customErrorMessage;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
* instead.
|
|
13
|
-
*/
|
|
14
|
-
label: string;
|
|
23
|
+
/** @internal This will be true when the control is in an invalid state. */
|
|
24
|
+
invalid: boolean;
|
|
15
25
|
/** The selected value of the control. */
|
|
16
26
|
value: string;
|
|
17
27
|
/** The name assigned to the radio controls. */
|
|
18
28
|
name: string;
|
|
19
29
|
/** Ensures a child radio is checked before allowing the containing form to submit. */
|
|
20
30
|
required: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* This will be true when the control is in an invalid state.
|
|
23
|
-
*/
|
|
24
|
-
invalid: boolean;
|
|
31
|
+
/**Feedback text for error state when validated */
|
|
25
32
|
invalidFeedback: string;
|
|
33
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
34
|
+
hasFeedback: boolean;
|
|
26
35
|
handleValueChange(): void;
|
|
27
36
|
connectedCallback(): void;
|
|
37
|
+
/** Gets and return the ValidityState object. */
|
|
28
38
|
get validity(): ValidityState;
|
|
29
39
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
30
40
|
reportValidity(): boolean;
|
|
@@ -33,9 +43,14 @@ export declare class SgdsRadioGroup extends SgdsElement {
|
|
|
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,11 +1,19 @@
|
|
|
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
|
+
/**@internal */
|
|
4
13
|
checked: boolean;
|
|
5
|
-
protected hasFocus: boolean;
|
|
6
14
|
/** The radio's value attribute. */
|
|
7
15
|
value: string;
|
|
8
|
-
/** For id/for pair of the HTML form control. */
|
|
16
|
+
/** For id/for pair of the HTML form control and label. */
|
|
9
17
|
radioId: string;
|
|
10
18
|
/** Disables the radio. */
|
|
11
19
|
disabled: boolean;
|
|
@@ -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
|
-
/**
|
|
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
|
|
27
|
+
*/
|
|
17
28
|
href: string;
|
|
29
|
+
/**
|
|
30
|
+
* 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
|
|
31
|
+
*/
|
|
18
32
|
collapseId: string;
|
|
33
|
+
/**
|
|
34
|
+
* 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
|
|
35
|
+
*/
|
|
19
36
|
buttonId: string;
|
|
37
|
+
/**
|
|
38
|
+
* Disables the SgdsSidenavItem
|
|
39
|
+
*/
|
|
20
40
|
disabled: boolean;
|
|
41
|
+
/** @internal */
|
|
21
42
|
private index;
|
|
22
43
|
private _onClick;
|
|
23
44
|
private _onClickButton;
|
|
24
45
|
private _onClickLink;
|
|
25
46
|
/**
|
|
26
|
-
*
|
|
47
|
+
* When invoked, closes the SgdsSidenavItem
|
|
27
48
|
*/
|
|
28
49
|
closeItem(): void;
|
|
29
50
|
/**
|
|
30
|
-
*
|
|
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
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,13 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
/**
|
|
3
|
+
* @summary The side navigation is used to display a list of links to move between pages within a related category. It is used as a secondary form of navigation where the primary navigation is located hierachically above the page frame.
|
|
3
4
|
* @slot - default slot for SgdsSidenavItem element.
|
|
5
|
+
*
|
|
6
|
+
* @cssproperty --sidenav-theme-color - overall sidenav theme color
|
|
4
7
|
*/
|
|
5
8
|
export declare class SgdsSidenav extends SgdsElement {
|
|
6
9
|
static styles: import("lit").CSSResultGroup;
|
|
10
|
+
/** Allow sidenav items to stay open when another item is opened */
|
|
7
11
|
alwaysOpen: boolean;
|
|
8
12
|
render(): import("lit").TemplateResult<1>;
|
|
9
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SgdsSpinner } 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;
|