diff --git a/.storybook/main.js b/.storybook/main.js index 9e47a21c..2bf0114b 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -10,14 +10,17 @@ module.exports = { "../stories/components/Accordion.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Alert.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Badge.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/components/Breadcrumb.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Button.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Checkbox.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Divider.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Footer.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Icon.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/components/IconButton.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Input.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Radio.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Masthead.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/components/Modal.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Progress.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Skeleton.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Spinner.@(mdx|stories.@(js|jsx|ts|tsx))", diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index b7cb76df..39cbbc80 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -8,7 +8,7 @@ Install SGDS web components locally with the following command ```js -npm install @govtechsg/sgds-web-component@3.0.0-rc.3 +npm install @govtechsg/sgds-web-component@3.0.0-rc.4 ``` @@ -62,13 +62,13 @@ This method registers all SGDS elements up front in the Custom Elements Registry ```js // Load global css file - + // it is recommended to load a particular version when using cdn e.g. https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@1.0.2 - + //or load a single component e.g. Masthead - + ``` diff --git a/index.html b/index.html index cb7ec4cb..b1eb24c9 100644 --- a/index.html +++ b/index.html @@ -283,7 +283,7 @@
Modal description
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dictum est vitae erat molestie blandit. Pellentesque at nunc at mi auctor imperdiet eu at leo. Integer aliquam, turpis vel ultricies ornare, sem massa commodo velit, pretium dictum quam nibh et ex. Suspendisse eu dignissim libero. Donec aliquam, lacus eu pellentesque interdum, arcu nisl blandit turpis, at tincidunt purus orci ut dolor. Morbi malesuada faucibus lorem, ornare accumsan sapien lacinia vel. In enim justo, hendrerit eu mi vitae, viverra fringilla nunc. Proin semper nunc a mollis faucibus. Nam at arcu non justo congue tincidunt. Donec vehicula felis risus, et lobortis lacus fringilla eu. Proin faucibus, nisi non semper elementum, sapien nisi viverra urna, id tempus augue felis ac nibh. Nullam pulvinar magna eros. Vestibulum at orci elit. Sed convallis fermentum gravida. diff --git a/src/components/Breadcrumb/sgds-breadcrumb-item.ts b/src/components/Breadcrumb/sgds-breadcrumb-item.ts index e11edce9..6ed67f47 100644 --- a/src/components/Breadcrumb/sgds-breadcrumb-item.ts +++ b/src/components/Breadcrumb/sgds-breadcrumb-item.ts @@ -2,14 +2,15 @@ import { html } from "lit"; import { property } from "lit/decorators.js"; import SgdsLink from "../Link/sgds-link"; import breadcrumbItemStyle from "./breadcrumb-item.css"; +import SgdsElement from "../../base/sgds-element"; /** * @summary Breadcrumb Item are navigational links used in Breadcrumb component * - * @slot default - The title of the item + * @slot default - The link of the item. Pass in anchor tags into this slot */ -export class SgdsBreadcrumbItem extends SgdsLink { +export class SgdsBreadcrumbItem extends SgdsElement { static styles = [...SgdsLink.styles, breadcrumbItemStyle]; - /** Specifies the url path of the breadcrumb-item. When defined, the breadcrumb-items is a anchor element. When not defined, indicates that the breadcrumb item is active. In such cases, a span element is rendered. */ + /** Indicates the link matches the current location of the page. Programmatically handled by SgdsBreadcrumb to set this prop to true for the last breadcrumb item */ @property({ type: Boolean, reflect: true }) active = false; render() { diff --git a/src/components/Icon/icon.css b/src/components/Icon/icon.css index 5f523beb..cfe83e2a 100644 --- a/src/components/Icon/icon.css +++ b/src/components/Icon/icon.css @@ -1,6 +1,6 @@ :host { color: inherit; - display: inline-block; + display: inline-flex; } :host([size="sm"]) svg { width: var(--sgds-icon-size-sm); diff --git a/src/components/IconButton/icon-button.css b/src/components/IconButton/icon-button.css index b9fefb61..53f4df47 100644 --- a/src/components/IconButton/icon-button.css +++ b/src/components/IconButton/icon-button.css @@ -1,3 +1,7 @@ +:host { + display: inline-block; +} + .btn.btn-icon { display: flex; width: var(--sgds-dimension-48, 56px); diff --git a/src/components/IconButton/sgds-icon-button.ts b/src/components/IconButton/sgds-icon-button.ts index d4926ee3..24feff19 100644 --- a/src/components/IconButton/sgds-icon-button.ts +++ b/src/components/IconButton/sgds-icon-button.ts @@ -9,8 +9,6 @@ import iconButtonStyles from "./icon-button.css"; /** * @summary An icon button is a user interface element that combines an icon and a button, serving as a clickable or tabbable component. * - * @slot default - The slot for sgds-icon - * * @event sgds-blur - Emitted when the button is blurred. * @event sgds-focus - Emitted when the button is focused. */ diff --git a/src/components/IconList/sgds-icon-list.ts b/src/components/IconList/sgds-icon-list.ts index c33058da..a379a9ad 100644 --- a/src/components/IconList/sgds-icon-list.ts +++ b/src/components/IconList/sgds-icon-list.ts @@ -1,36 +1,24 @@ -import SgdsElement from "../../base/sgds-element"; import { html } from "lit"; -import iconListStyles from "./icon-list.css"; import { property } from "lit/decorators.js"; import { classMap } from "lit/directives/class-map.js"; -import SgdsIcon from "../Icon/sgds-icon"; -import { ifDefined } from "lit/directives/if-defined.js"; +import SgdsElement from "../../base/sgds-element"; +import iconListStyles from "./icon-list.css"; /** * @summary A IconList can be used to display content related to the same topic. Each list item begins an icon. * - * @slot default - The list items of IconList. Each list items should have aria attribute role="list" added + * @slot default - The list items of IconList. Each list items should have aria attribute role="listitem" added */ export class SgdsIconList extends SgdsElement { static styles = [...SgdsElement.styles, iconListStyles]; - static dependencies = { "sgds-icon": SgdsIcon }; /** Sets the aria-role of the sgds-icon-list */ @property({ type: String, reflect: true }) role = "list"; /** The size of icon list. Changes the font-size the list items */ @property({ type: String, reflect: true }) size: "sm" | "md" | "lg" = "md"; - /** The name of the icon from sgds icon library */ - @property({ type: String, reflect: true }) name: string; - - private _assignIconSize(buttonSize: "sm" | "md" | "lg") { - if (buttonSize === "sm") return "md"; - if (buttonSize === "md") return "lg"; - if (buttonSize === "lg") return "xl"; - } render() { return html`
Modal description
++ Etiam suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in +
+Modal description
++ Etiam suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in Etiam + suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in Etiam + suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in Etiam + suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in Etiam + suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in +
+Modal description
++ Etiam suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in +
+Modal description
++ Etiam suscipit nisi eget porta cursus. Ut sit amet felis aliquet, pellentesque mi at, vulputate nunc. Vivamus ac + facilisis tellus. Maecenas ac libero scelerisque tellus maximus accumsan a vehicula arcu. Aenean quis leo + gravida, congue sapien eu, rhoncus ante. Quisque velit est, sodales vitae turpis vitae, hendrerit facilisis + nulla. Suspendisse potenti. Nulla hendrerit enim sed leo rutrum auctor. Praesent volutpat rutrum purus in +