diff --git a/dist/components/button/button.css b/dist/components/button/button.css deleted file mode 100644 index cf5f7b1..0000000 --- a/dist/components/button/button.css +++ /dev/null @@ -1,229 +0,0 @@ -:host { - --padding-inline: 16px; - - display: inline-block; - min-width: 0; - max-width: 100%; -} - -.base { - display: inline-flex; - align-items: center; - justify-content: center; - column-gap: 4px; - color: var(--color-semantic-text-button-outline-default); - border-radius: 5px; - border: 1px solid transparent; - background-color: transparent; - min-height: 28px; - max-width: calc(100% - var(--padding-inline)*2); - padding-inline: var(--padding-inline); - position: relative; - overflow: hidden; - cursor: pointer; -} - -.base__text { - min-width: 0; - font-size: 10px; - font-weight: bold; - line-height: 1; - overflow-wrap : break-word; -} - -.type__default.appearance__outline { - border-color: var(--color-semantic-border-button-outline-default); -} - -.type__default.appearance__outline:hover:not(:disabled) { - - border-color: var(--color-semantic-border-button-outline-hover); - color: var(--color-semantic-text-button-outline-hover); -} - -.type__default.appearance__outline:focus-visible:not(:is(:disabled, .isSelected)) { - - border-color: var(--color-semantic-border-button-outline-focus); - color: var(--color-semantic-text-button-outline-focus); -} - -.type__default.appearance__fill { - - border-color: var(--color-semantic-border-button-fill-default); - background-color: var(--color-semantic-surface-button-fill-default); - color: var(--color-semantic-text-button-fill-default); -} - -.type__default.appearance__fill:hover:not(:disabled) { - border-color: var(--color-semantic-border-button-fill-hover); - background-color: var(--color-semantic-surface-button-fill-hover); -} - -.type__default.appearance__fill:focus-visible:not(:is(:disabled, .isSelected)) { - border-color: var(--color-semantic-border-button-fill-focus); - background-color: var(--color-semantic-surface-button-fill-focus); -} - -.type__default.appearance__text { - border-color: var(--color-semantic-border-button-text-default); - background-color: var(--color-semantic-surface-button-text-default); -} - -.type__default.appearance__text:hover:not(:disabled) { - border-color: var(--color-semantic-border-button-text-hover); - background-color: var(--color-semantic-surface-button-text-hover); -} - -.type__default.appearance__text:focus-visible:not(:is(:disabled, .isSelected)) { - border-color: var(--color-semantic-border-button-text-focus); - background-color: var(--color-semantic-surface-button-text-focus); -} - -.type__default.isSelected { - - border-color: var(--color-semantic-border-button-selected); - background-color: var(--color-semantic-surface-button-selected); - color: var(--color-semantic-text-button-selected); -} - -.type__default.isSelected:hover:not(:disabled) { - - border-color: var(--color-semantic-border-button-selected-hover); - background-color: var(--color-semantic-surface-button-selected-hover); - color: var(--color-semantic-text-button-selected); -} - -.type__destructive.appearance__outline { - - border-color: var(--color-semantic-border-button-outline-destructive-default); - color: var(--color-semantic-text-button-outline-destructive-default); -} - -.type__destructive.appearance__outline:hover:not(:disabled) { - - border-color: var(--color-semantic-border-button-outline-destructive-hover); - color: var(--color-semantic-text-button-outline-destructive-hover); -} - -.type__destructive.appearance__outline:focus-visible:not(:disabled) { - - border-color: var(--color-semantic-border-button-outline-destructive-focus); - color: var(--color-semantic-text-button-outline-destructive-focus); -} - -.type__destructive.appearance__fill { - - border-color: var(--color-semantic-border-button-fill-destructive-default); - background-color: var( - --color-semantic-surface-button-fill-destructive-default - ); - color: var(--color-semantic-text-button-fill-destructive-default); -} - -.type__destructive.appearance__fill:hover:not(:disabled) { - border-color: var(--color-semantic-border-button-fill-destructive-hover); - background-color: var(--color-semantic-surface-button-fill-destructive-hover); -} - -.type__destructive.appearance__fill:focus-visible:not(:disabled) { - border-color: var(--color-semantic-border-button-fill-destructive-focus); - background-color: var(--color-semantic-surface-button-fill-destructive-focus); -} - -.type__destructive.appearance__text { - - border-color: transparent; - background-color: transparent; - color: var(--color-semantic-text-button-text-destructive-default); -} - -.type__destructive.appearance__text:hover:not(:disabled) { - border-color: var(--color-semantic-border-button-text-destructive-hover); - background-color: var(--color-semantic-surface-button-text-destructive-hover); -} - -.type__destructive.appearance__text:focus-visible:not(:disabled) { - border-color: var(--color-semantic-border-button-text-destructive-focus); - background-color: var(--color-semantic-surface-button-text-destructive-focus); -} - -/* disabledとisLoadingにおいては、上記の詳細度と同等とするために:isを不可している */ -:is(.type__default, .type__destructive):disabled { - - border-color: var(--color-semantic-border-button-disabled); - background-color: var(--color-semantic-surface-button-disabled); - color: var(--color-semantic-text-button-disabled); - cursor: not-allowed; -} - -:is(.type__default, .type__destructive).isLoading { - border-color: var(--color-semantic-border-button-loading); - background-color: var(--color-semantic-surface-button-loading); -} - -:is(.type__default, .type__destructive).isLoading::before { - content: ""; - display: block; - background: transparent url("data:image/png;base64,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") no-repeat 50% 50%; - background-size: 16px 16px; - animation: 1s linear infinite loading; - transform-origin: center center; - width: 100%; - height: 100%; - z-index: 2; - position: absolute; - left: 0; - top: 0; - border-radius: 5px; -} - -@keyframes loading { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -:is(.type__default, .type__destructive).isLoading:hover { - cursor: not-allowed; - border-color: var(--color-semantic-border-button-loading); -} - -:is(.type__default, .type__destructive).isLoading .base__text { - visibility: hidden; -} - -:is(.type__default, .type__destructive).isLoading .base__icon { - visibility: hidden; -} - -.type__default.size__large { - --padding-inline: 24px; - - column-gap: 8px; - min-height: 32px; - font-size: 12px; -} - -.type__default.size__xLarge { - --padding-inline: 40px; - - column-gap: 8px; - min-height: 40px; - font-size: 12px; -} - -.size__width80 { - --padding-inline: 4px; - - width: 80px; -} - -.size__width160 { - --padding-inline: 4px; - - width: 160px; -} diff --git a/dist/components/button/sp-button.d.ts.map b/dist/components/button/sp-button.d.ts.map deleted file mode 100644 index c302531..0000000 --- a/dist/components/button/sp-button.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/sp-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMhD,qBAAa,QAAS,SAAQ,QAAQ;;IAIpC,IAAI,IAAI,IAGM,eAAe,GAAG,EAAE,CADjC;IACD,IAAI,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,EAAE,EAUjC;IAED,MAAM,KAAK,kBAAkB,aAE5B;;IAYD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAqB1E;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/checkbox-list.css b/dist/components/checkbox/checkbox-list.css deleted file mode 100644 index ad24b20..0000000 --- a/dist/components/checkbox/checkbox-list.css +++ /dev/null @@ -1,46 +0,0 @@ -:host { - display: block; - min-width: 0; -} - -.base { - display: flex; - align-items: flex-start; - justify-content: flex-start; - padding-block: 1px; - cursor: pointer; -} - -.base:has(input:disabled) { - cursor: not-allowed; -} - -.base:has(.input:focus-visible) { - outline: 2px solid var(--color-semantic-text-body-regular); - outline-offset: 2px; -} - -.base:has(input):not(:has(input:disabled)):hover { - background: var(--color-semantic-surface-regular-3); -} - -.base:has(input:checked):not(:has(input:disabled)) { - background: var(--color-semantic-surface-checked); -} - -.base:has(input:checked):not(:has(input:disabled)):hover { - background: var(--color-semantic-surface-checked-hover); -} - -.text { - min-width: 0; - padding-block-start: 2.5px; - color: var(--color-semantic-text-body-regular); - font-size: 12px; - line-height: 1.6; - overflow-wrap : break-word; -} - -.base:has(input:disabled) .text { - color: var(--color-semantic-text-disabled); -} diff --git a/dist/components/checkbox/checkbox-text.css b/dist/components/checkbox/checkbox-text.css deleted file mode 100644 index 5ee3025..0000000 --- a/dist/components/checkbox/checkbox-text.css +++ /dev/null @@ -1,44 +0,0 @@ -:host { - display: inline-block; - min-width: 0; - max-width: 100%; -} - -.base { - display: inline-flex; - align-items: flex-start; - justify-content: flex-start; - max-width: 100%; - cursor: pointer; -} - -.base:has(.input:focus-visible) { - outline: 2px solid var(--color-semantic-text-body-regular); - outline-offset: 2px; -} - -.base:has(.input:disabled) { - cursor: not-allowed; -} - -.text { - min-width: 0; - padding-block-start: 2.5px; - color: var(--color-semantic-text-body-regular); - font-size: 12px; - line-height: 1.6; - overflow-wrap: break-word; -} - -.base:has(.input:disabled) .text { - color: var(--color-semantic-text-disabled); -} - -.base:hover .checkmark:has(:not(.input:disabled))::before { - background-color: var(--color-semantic-surface-regular-3); -} - -.base:hover .checkmark:has(:is(.input:checked, .input:indeterminate)):has(:not(.input:disabled))::before{ - background-color: var(--color-semantic-surface-selected-hover); - border-color: var(--color-semantic-border-selected-hover); -} \ No newline at end of file diff --git a/dist/components/checkbox/checkbox.css b/dist/components/checkbox/checkbox.css deleted file mode 100644 index 230c59b..0000000 --- a/dist/components/checkbox/checkbox.css +++ /dev/null @@ -1,17 +0,0 @@ -:host { - display: inline-block; -} - -.base:has(.input:focus-visible) { - outline: 2px solid var(--color-semantic-text-body-regular); - outline-offset: 2px; -} - -.base:hover .checkmark:has(:not(.input:disabled))::before { - background-color: var(--color-semantic-surface-regular-3); -} - -.base:hover .checkmark:has(:is(.input:checked, .input:indeterminate)):has(:not(.input:disabled))::before{ - background-color: var(--color-semantic-surface-selected-hover); - border-color: var(--color-semantic-border-selected-hover); -} diff --git a/dist/components/checkbox/checkmark.css b/dist/components/checkbox/checkmark.css deleted file mode 100644 index 760e831..0000000 --- a/dist/components/checkbox/checkmark.css +++ /dev/null @@ -1,51 +0,0 @@ -.checkmark { - flex-grow: 0; - flex-shrink: 0; - display: inline-flex; - padding-block: 4px; - padding-inline: 4px; - cursor: pointer; -} - -.checkmark::before { - content: ''; - display: inline-block; - width: 16px; - height: 16px; - background: var(--color-semantic-surface-regular-1) 50% 50% no-repeat; - border: 1px solid var(--color-semantic-border-check-unchecked); - border-radius: 2px; -} - -.checkmark:has(.input:focus-visible)::before { - border-color: var(--color-semantic-border-focus); - box-shadow: 0 0 0 3px var(--color-semantic-highlight-focus-ring-default); -} - -.checkmark:has(:is(.input:checked, .input:indeterminate))::before { - background-color: var(--color-semantic-surface-selected); - border-color: var(--color-semantic-border-selected); -} - -.checkmark:has(.input:checked)::before { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%227%22%20fill%3D%22none%22%3E%3Cpath%20stroke%3D%22%23fff%22%20stroke-width%3D%221.5%22%20d%3D%22m1%203%202%202%204-4%22%2F%3E%3C%2Fsvg%3E"); -} - -.checkmark:has(.input:indeterminate)::before { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%222%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h8v2H0z%22%2F%3E%3C%2Fsvg%3E"); -} - -.checkmark:has(.input:disabled) { - cursor: not-allowed; -} - -.checkmark:has(:is(.input:disabled))::before { - background-color: var(--color-semantic-surface-check-disabled); - border-color: var(--color-semantic-border-regular); -} - -.checkmark .input { - position: absolute; - z-index: -1; - opacity: 0; -} diff --git a/dist/components/checkbox/sp-checkbox-list.d.ts.map b/dist/components/checkbox/sp-checkbox-list.d.ts.map deleted file mode 100644 index f642d2b..0000000 --- a/dist/components/checkbox/sp-checkbox-list.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-checkbox-list.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/sp-checkbox-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAWvE,qBAAa,cAAe,SAAQ,cAAc;;CAQjD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/sp-checkbox-text.d.ts.map b/dist/components/checkbox/sp-checkbox-text.d.ts.map deleted file mode 100644 index 4a4afef..0000000 --- a/dist/components/checkbox/sp-checkbox-text.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-checkbox-text.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/sp-checkbox-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAWvE,qBAAa,cAAe,SAAQ,cAAc;;CAQjD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/sp-checkbox.d.ts.map b/dist/components/checkbox/sp-checkbox.d.ts.map deleted file mode 100644 index aed5b46..0000000 --- a/dist/components/checkbox/sp-checkbox.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/sp-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAWnE,qBAAa,UAAW,SAAQ,UAAU;;CAQzC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"} \ No newline at end of file diff --git a/dist/components/foundation.css b/dist/components/foundation.css deleted file mode 100644 index 62d73c5..0000000 --- a/dist/components/foundation.css +++ /dev/null @@ -1,7 +0,0 @@ -:host { - font-family: var(--font-ja); -} - -:host:lang(zh) { - font-family: var(--font-zh); -} diff --git a/dist/components/icon/icon.css b/dist/components/icon/icon.css deleted file mode 100644 index a4533d5..0000000 --- a/dist/components/icon/icon.css +++ /dev/null @@ -1,22 +0,0 @@ -:host { - flex-grow: 0; - flex-shrink: 0; - display: inline-block; - line-height: 0; - vertical-align: middle; -} - -.icon { - display: inline-block; - fill: var(--icon-color, var(--color-primitive-neutral-100)); -} - -.size__small { - width: 16px; - height: 16px; -} - -.size__medium { - width: 24px; - height: 24px; -} \ No newline at end of file diff --git a/dist/components/icon/icons.d.ts b/dist/components/icon/icons.d.ts deleted file mode 100644 index 83068f1..0000000 --- a/dist/components/icon/icons.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export declare const speedaIconTypes: readonly ["arrow_down", "arrow_down_link", "arrow_left", "arrow_left_link", "arrow_right", "arrow_right_link", "arrow_up", "arrow_up_link", "bookmark", "calendar", "check", "check_bold", "clear", "close", "copy", "create", "delete", "doublearrow_down", "doublearrow_left", "doublearrow_right", "download", "drag", "edit", "error", "folder", "help", "kebab_menu", "like", "list", "location", "lock", "mail", "menu", "my_speeda", "notification", "open_in_new", "operator", "opinion", "people", "person", "pib", "plus", "search", "settings", "sort", "sort_down", "sort_up", "toggle_arrow_down", "toggle_arrow_right", "zip"]; -export type SpeedaIconTypes = (typeof speedaIconTypes)[number]; -export declare const speedaIconPaths: { - arrow_down: string; - arrow_down_link: string; - arrow_left: string; - arrow_left_link: string; - arrow_right: string; - arrow_right_link: string; - arrow_up: string; - arrow_up_link: string; - bookmark: string; - calendar: string; - check: string; - check_bold: string; - clear: string; - close: string; - copy: string; - create: string; - delete: string; - doublearrow_down: string; - doublearrow_left: string; - doublearrow_right: string; - download: string; - drag: string; - edit: string; - error: string; - folder: string; - help: string; - kebab_menu: string; - like: string; - list: string; - location: string; - lock: string; - mail: string; - menu: string; - my_speeda: string; - notification: string; - open_in_new: string; - operator: string; - opinion: string; - people: string; - person: string; - pib: string; - plus: string; - search: string; - settings: string; - sort: string; - sort_down: string; - sort_up: string; - toggle_arrow_down: string; - toggle_arrow_right: string; - zip: string; -}; -//# sourceMappingURL=icons.d.ts.map \ No newline at end of file diff --git a/dist/components/icon/icons.d.ts.map b/dist/components/icon/icons.d.ts.map deleted file mode 100644 index b5fca57..0000000 --- a/dist/components/icon/icons.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icons.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,8mBAmDlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD3B,CAAC"} \ No newline at end of file diff --git a/dist/components/icon/sp-icon.d.ts.map b/dist/components/icon/sp-icon.d.ts.map deleted file mode 100644 index f6978af..0000000 --- a/dist/components/icon/sp-icon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/sp-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAS/D,qBAAa,MAAO,SAAQ,MAAM;IAChC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAmB;;CASzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"} \ No newline at end of file diff --git a/dist/components/icon/sp-icon.js b/dist/components/icon/sp-icon.js deleted file mode 100644 index 105ee92..0000000 --- a/dist/components/icon/sp-icon.js +++ /dev/null @@ -1,17 +0,0 @@ -import { UbIcon } from "@ub-design/components-web-components/"; -import { speedaIconPaths } from "./icons"; -// @ts-ignore -import iconStyle from "./icon.css?inline" assert { type: "css" }; -const styles = new CSSStyleSheet(); -styles.replaceSync(iconStyle); -export class SpIcon extends UbIcon { - constructor() { - super(); - this.paths = speedaIconPaths; - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; - } -} -customElements.get("sp-icon") || customElements.define("sp-icon", SpIcon); diff --git a/dist/components/radio/radio-button-text-group.css b/dist/components/radio/radio-button-text-group.css deleted file mode 100644 index 160d767..0000000 --- a/dist/components/radio/radio-button-text-group.css +++ /dev/null @@ -1,111 +0,0 @@ -:host { - display: inline-block; - min-width: 0; - max-width: 100%; -} - -.base { - display: flex; - flex-wrap: wrap; - gap: 8px; -} - -.base:has(:focus-visible) { - outline: auto; -} - -.base.horizontal { - flex-direction: row; -} - -.base.vertical { - flex-direction: column; -} - -.item { - display: inline-flex; - justify-content: flex-start; - align-items: flex-start; - min-width: 0; -} - -.text { - min-width: 0; - color: var(--color-semantic-text-body-regular); - font-size: 12px; - line-height: 1.6; - overflow-wrap : break-word; - padding-block: 2.5px; - cursor: pointer; -} - -.input { - position: absolute; - left: 0; - top: 0; - opacity: 0; - width: 100%; - height: 100%; - cursor: pointer; -} - -.radio { - position: relative; - flex-grow: 0; - flex-shrink: 0; - display: inline-flex; - padding-block: 4px; - padding-inline: 4px; -} - -.radio::before { - content: ''; - display: inline-block; - width: 16px; - height: 16px; - background: var(--color-semantic-surface-regular-1) 50% 50% no-repeat; - border: 1px solid var(--color-semantic-border-check-unchecked); - border-radius: 50%; -} - -.radio:has(.input:focus-visible)::before { - outline: auto; - outline-offset: 4px; - border-color: var(--color-semantic-border-focus); - box-shadow: 0 0 0 3px var(--color-semantic-highlight-focus-ring-default); -} - -.radio:has(.input:checked)::before { - background-color: var(--color-semantic-surface-regular-1); - border-width: 4px; -} - -.radio:has(.input:checked:not(:disabled))::before { - border-color: var(--color-semantic-border-selected); -} - -.item:has(.input:disabled) :is(.input, .text) { - cursor: not-allowed; -} - -.item:has(.input:disabled) .text { - color: var(--color-semantic-text-disabled); -} - -.item .radio:has(.input:disabled)::before { - background-color: var(--color-semantic-surface-check-disabled); - border-color: var(--color-semantic-border-regular); -} - -.item .radio:has(.input:checked:disabled)::before { - background-color: var(--color-semantic-surface-regular-1); -} - -.item:has(:is(.input:hover, .text:hover)):not(:has(:is(.input:checked, .input:disabled))) .radio::before { - background-color: var(--color-semantic-surface-regular-3); -} - -.item:has(.input:checked:hover:not(:disabled)) .radio::before, -.item:has(.input:checked:not(:disabled)):has(.text:hover) .radio::before { - border-color: var(--color-semantic-border-selected-hover); -} \ No newline at end of file diff --git a/dist/components/radio/sp-radio-button-text-group.d.ts.map b/dist/components/radio/sp-radio-button-text-group.d.ts.map deleted file mode 100644 index 90a240a..0000000 --- a/dist/components/radio/sp-radio-button-text-group.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-radio-button-text-group.d.ts","sourceRoot":"","sources":["../../../src/components/radio/sp-radio-button-text-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAS/E,qBAAa,sBAAuB,SAAQ,sBAAsB;;CAQjE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,sBAAsB,CAAC;KACtD;CACF"} \ No newline at end of file diff --git a/dist/components/segmentedControl/segmented-control.css b/dist/components/segmentedControl/segmented-control.css deleted file mode 100644 index 9d94817..0000000 --- a/dist/components/segmentedControl/segmented-control.css +++ /dev/null @@ -1,89 +0,0 @@ -:host { - display: inline-block; - min-width: 0; - max-width: 100%; - line-height: 0; - vertical-align: middle; -} - -.base { - display: inline-flex; - max-width: 100%; -} - -.item { - flex: 1 0 80px; - position: relative; - display: flex; - align-items: stretch; - min-width: 80px; -} - -.radio { - position: absolute; - z-index: -1; - width: 100%; - height: 100%; -} - -.input { - width: 100%; - height: 100%; - opacity: 0; -} - -.text { - flex-grow: 1; - display: flex; - align-items: center; - justify-content: center; - min-width: 0; - padding-block: 8px; - padding-inline: 8px; - background-color: var(--color-semantic-surface-regular-2); - border: 1px solid var(--color-semantic-border-regular); - border-right: none; - color: var(--color-semantic-text-body-semi-weak); - font-size: 10px; - line-height: 1.6; - text-align: center; - overflow-wrap : break-word; -} - -.text:hover { - background-color: var(--color-semantic-surface-regular-4); -} - -.item:first-child .text { - border-radius: 5px 0 0 5px; -} - -.item:last-child .text { - border-radius: 0 5px 5px 0; - border-right: 1px solid var(--color-semantic-border-regular); -} - -.item:has(.input:focus-visible) .text { - outline: auto; - outline-offset: -4px; - background-color: var(--color-semantic-surface-regular-4); -} - -.item:has(.input:checked) .text { - background-color: var(--color-semantic-surface-selected); - border-color: var(--color-semantic-border-selected); - color: var(--color-semantic-text-inverse); - font-weight: bold; - cursor: default; -} - -.item:has(.input:disabled) .text { - background-color: var(--color-semantic-surface-regular-2); - color: var(--color-semantic-text-disabled); - cursor: not-allowed; -} - -.text-inner { - min-width: 0; - overflow-wrap: break-word; -} \ No newline at end of file diff --git a/dist/components/segmentedControl/sp-segmented-control.d.ts.map b/dist/components/segmentedControl/sp-segmented-control.d.ts.map deleted file mode 100644 index 9fc65a0..0000000 --- a/dist/components/segmentedControl/sp-segmented-control.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sp-segmented-control.d.ts","sourceRoot":"","sources":["../../../src/components/segmentedControl/sp-segmented-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAS/E,qBAAa,kBAAmB,SAAQ,sBAAsB;;CAQ7D;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"} \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map deleted file mode 100644 index 224a41b..0000000 --- a/dist/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC"} \ No newline at end of file diff --git a/dist/components/button/sp-button.d.ts b/dist/src/components/button/sp-button.d.ts similarity index 76% rename from dist/components/button/sp-button.d.ts rename to dist/src/components/button/sp-button.d.ts index 5bdc6b3..809bba9 100644 --- a/dist/components/button/sp-button.d.ts +++ b/dist/src/components/button/sp-button.d.ts @@ -1,9 +1,8 @@ import { UbButton } from "@ub-design/components-web-components/"; -import { SpeedaIconTypes } from "../icon/icons"; export declare class SpButton extends UbButton { #private; - get icon(): SpeedaIconTypes | ""; - set icon(val: SpeedaIconTypes | ""); + get icon(): string; + set icon(val: string); static get observedAttributes(): string[]; constructor(); attributeChangedCallback(name: string, oldValue: string, newValue: string): void; diff --git a/dist/src/components/button/sp-button.d.ts.map b/dist/src/components/button/sp-button.d.ts.map new file mode 100644 index 0000000..15d82fa --- /dev/null +++ b/dist/src/components/button/sp-button.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/sp-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAUjE,qBAAa,QAAS,SAAQ,QAAQ;;IAIpC,IAAI,IAAI,IAGM,MAAM,CADnB;IACD,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,EAUnB;IAED,MAAM,KAAK,kBAAkB,aAE5B;;IAgBD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAqB1E;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"} \ No newline at end of file diff --git a/dist/components/button/sp-button.js b/dist/src/components/button/sp-button.js similarity index 95% rename from dist/components/button/sp-button.js rename to dist/src/components/button/sp-button.js index 536104c..a35b5c2 100644 --- a/dist/components/button/sp-button.js +++ b/dist/src/components/button/sp-button.js @@ -43,10 +43,12 @@ export class SpButton extends UbButton { _SpButton_instances.add(this); _SpButton_icon.set(this, ""); _SpButton_iconElement.set(this, new SpIcon()); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } __classPrivateFieldGet(this, _SpButton_iconElement, "f").classList.add("base__icon"); __classPrivateFieldGet(this, _SpButton_iconElement, "f").size = "small"; } diff --git a/dist/components/checkbox/sp-checkbox-list.d.ts b/dist/src/components/checkbox/sp-checkbox-list.d.ts similarity index 100% rename from dist/components/checkbox/sp-checkbox-list.d.ts rename to dist/src/components/checkbox/sp-checkbox-list.d.ts diff --git a/dist/src/components/checkbox/sp-checkbox-list.d.ts.map b/dist/src/components/checkbox/sp-checkbox-list.d.ts.map new file mode 100644 index 0000000..e65e3bb --- /dev/null +++ b/dist/src/components/checkbox/sp-checkbox-list.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-checkbox-list.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/sp-checkbox-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAWvE,qBAAa,cAAe,SAAQ,cAAc;;CAWjD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/sp-checkbox-list.js b/dist/src/components/checkbox/sp-checkbox-list.js similarity index 78% rename from dist/components/checkbox/sp-checkbox-list.js rename to dist/src/components/checkbox/sp-checkbox-list.js index 134c838..673cc28 100644 --- a/dist/components/checkbox/sp-checkbox-list.js +++ b/dist/src/components/checkbox/sp-checkbox-list.js @@ -10,10 +10,12 @@ styles.replaceSync(`${foundationStyle} ${checkmarkStyle} ${checkboxListStyle}`); export class SpCheckboxList extends UbCheckboxText { constructor() { super(); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } } } customElements.get("sp-checkbox-list") || diff --git a/dist/components/checkbox/sp-checkbox-text.d.ts b/dist/src/components/checkbox/sp-checkbox-text.d.ts similarity index 100% rename from dist/components/checkbox/sp-checkbox-text.d.ts rename to dist/src/components/checkbox/sp-checkbox-text.d.ts diff --git a/dist/src/components/checkbox/sp-checkbox-text.d.ts.map b/dist/src/components/checkbox/sp-checkbox-text.d.ts.map new file mode 100644 index 0000000..cbc1890 --- /dev/null +++ b/dist/src/components/checkbox/sp-checkbox-text.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-checkbox-text.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/sp-checkbox-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAWvE,qBAAa,cAAe,SAAQ,cAAc;;CAWjD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/sp-checkbox-text.js b/dist/src/components/checkbox/sp-checkbox-text.js similarity index 78% rename from dist/components/checkbox/sp-checkbox-text.js rename to dist/src/components/checkbox/sp-checkbox-text.js index ab9f946..65b73dc 100644 --- a/dist/components/checkbox/sp-checkbox-text.js +++ b/dist/src/components/checkbox/sp-checkbox-text.js @@ -10,10 +10,12 @@ styles.replaceSync(`${foundationStyle} ${checkmarkStyle} ${checkboxTextStyle}`); export class SpCheckboxText extends UbCheckboxText { constructor() { super(); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } } } customElements.get("sp-checkbox-text") || diff --git a/dist/components/checkbox/sp-checkbox.d.ts b/dist/src/components/checkbox/sp-checkbox.d.ts similarity index 100% rename from dist/components/checkbox/sp-checkbox.d.ts rename to dist/src/components/checkbox/sp-checkbox.d.ts diff --git a/dist/src/components/checkbox/sp-checkbox.d.ts.map b/dist/src/components/checkbox/sp-checkbox.d.ts.map new file mode 100644 index 0000000..ee3adf7 --- /dev/null +++ b/dist/src/components/checkbox/sp-checkbox.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/sp-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAWnE,qBAAa,UAAW,SAAQ,UAAU;;CAWzC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"} \ No newline at end of file diff --git a/dist/components/checkbox/sp-checkbox.js b/dist/src/components/checkbox/sp-checkbox.js similarity index 77% rename from dist/components/checkbox/sp-checkbox.js rename to dist/src/components/checkbox/sp-checkbox.js index 76c31b6..539a733 100644 --- a/dist/components/checkbox/sp-checkbox.js +++ b/dist/src/components/checkbox/sp-checkbox.js @@ -10,10 +10,12 @@ styles.replaceSync(`${foundationStyle} ${checkmarkStyle} ${checkboxStyle}`); export class SpCheckbox extends UbCheckbox { constructor() { super(); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } } } customElements.get("sp-checkbox") || diff --git a/dist/src/components/icon/icons.d.ts b/dist/src/components/icon/icons.d.ts new file mode 100644 index 0000000..32007fa --- /dev/null +++ b/dist/src/components/icon/icons.d.ts @@ -0,0 +1,6 @@ +export declare const speedaIconTypes: readonly ["arrow_down", "arrow_down_link", "arrow_left", "arrow_left_link", "arrow_right", "arrow_right_link", "arrow_up", "arrow_up_link", "bookmark", "calendar", "check", "check_bold", "clear", "close", "copy", "create", "delete", "doublearrow_down", "doublearrow_left", "doublearrow_right", "download", "drag", "edit", "error", "folder", "help", "kebab_menu", "like", "list", "location", "lock", "mail", "menu", "my_speeda", "notification", "open_in_new", "operator", "opinion", "people", "person", "pib", "plus", "search", "settings", "sort", "sort_down", "sort_up", "toggle_arrow_down", "toggle_arrow_right", "zip"]; +export type SpeedaIconTypes = (typeof speedaIconTypes)[number]; +export declare const speedaIconPaths: { + [key in SpeedaIconTypes]: string; +}; +//# sourceMappingURL=icons.d.ts.map \ No newline at end of file diff --git a/dist/src/components/icon/icons.d.ts.map b/dist/src/components/icon/icons.d.ts.map new file mode 100644 index 0000000..82bbb35 --- /dev/null +++ b/dist/src/components/icon/icons.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/icons.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,8mBAmDlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE;KAAE,GAAG,IAAI,eAAe,GAAG,MAAM;CAmD9D,CAAC"} \ No newline at end of file diff --git a/dist/components/icon/icons.js b/dist/src/components/icon/icons.js similarity index 100% rename from dist/components/icon/icons.js rename to dist/src/components/icon/icons.js diff --git a/dist/components/icon/sp-icon.d.ts b/dist/src/components/icon/sp-icon.d.ts similarity index 92% rename from dist/components/icon/sp-icon.d.ts rename to dist/src/components/icon/sp-icon.d.ts index 564b19d..1bd8048 100644 --- a/dist/components/icon/sp-icon.d.ts +++ b/dist/src/components/icon/sp-icon.d.ts @@ -1,6 +1,7 @@ import { UbIcon } from "@ub-design/components-web-components/"; export declare class SpIcon extends UbIcon { paths: { + "": string; arrow_down: string; arrow_down_link: string; arrow_left: string; @@ -53,6 +54,8 @@ export declare class SpIcon extends UbIcon { zip: string; }; constructor(); + set type(value: string); + attributeChangedCallback(name: string, oldValue: string, newValue: string): void; } declare global { interface HTMLElementTagNameMap { diff --git a/dist/src/components/icon/sp-icon.d.ts.map b/dist/src/components/icon/sp-icon.d.ts.map new file mode 100644 index 0000000..6d8b6f3 --- /dev/null +++ b/dist/src/components/icon/sp-icon.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-icon.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/sp-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAa/D,qBAAa,MAAO,SAAQ,MAAM;IAChC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkC;;IAavC,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,wBAAwB,CACtB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,IAAI;CAQR;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"} \ No newline at end of file diff --git a/dist/src/components/icon/sp-icon.js b/dist/src/components/icon/sp-icon.js new file mode 100644 index 0000000..60f831b --- /dev/null +++ b/dist/src/components/icon/sp-icon.js @@ -0,0 +1,34 @@ +import { UbIcon } from "@ub-design/components-web-components/"; +import { speedaIconPaths } from "./icons"; +// @ts-ignore +import iconStyle from "./icon.css?inline" assert { type: "css" }; +function isSpeedaIconType(type) { + return speedaIconPaths.hasOwnProperty(type); +} +const styles = new CSSStyleSheet(); +styles.replaceSync(iconStyle); +export class SpIcon extends UbIcon { + constructor() { + super(); + this.paths = { ...speedaIconPaths, "": "" }; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } + } + set type(value) { + super.type = isSpeedaIconType(value) ? value : ""; + } + attributeChangedCallback(name, oldValue, newValue) { + if (name === "type") { + const type = isSpeedaIconType(newValue) ? newValue : ""; + super.attributeChangedCallback(name, oldValue, type); + } + else { + super.attributeChangedCallback(name, oldValue, newValue); + } + } +} +customElements.get("sp-icon") || customElements.define("sp-icon", SpIcon); diff --git a/dist/components/radio/sp-radio-button-text-group.d.ts b/dist/src/components/radio/sp-radio-button-text-group.d.ts similarity index 100% rename from dist/components/radio/sp-radio-button-text-group.d.ts rename to dist/src/components/radio/sp-radio-button-text-group.d.ts diff --git a/dist/src/components/radio/sp-radio-button-text-group.d.ts.map b/dist/src/components/radio/sp-radio-button-text-group.d.ts.map new file mode 100644 index 0000000..0c6f3d9 --- /dev/null +++ b/dist/src/components/radio/sp-radio-button-text-group.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-radio-button-text-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/sp-radio-button-text-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAS/E,qBAAa,sBAAuB,SAAQ,sBAAsB;;CAWjE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,sBAAsB,CAAC;KACtD;CACF"} \ No newline at end of file diff --git a/dist/components/radio/sp-radio-button-text-group.js b/dist/src/components/radio/sp-radio-button-text-group.js similarity index 77% rename from dist/components/radio/sp-radio-button-text-group.js rename to dist/src/components/radio/sp-radio-button-text-group.js index 027f95d..aedd080 100644 --- a/dist/components/radio/sp-radio-button-text-group.js +++ b/dist/src/components/radio/sp-radio-button-text-group.js @@ -8,10 +8,12 @@ styles.replaceSync(`${foundationStyle} ${radioButtonTextGroupStyle}`); export class SpRadioButtonTextGroup extends UbRadioButtonTextGroup { constructor() { super(); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } } } customElements.get("sp-radio-button-text-group") || diff --git a/dist/components/segmentedControl/sp-segmented-control.d.ts b/dist/src/components/segmentedControl/sp-segmented-control.d.ts similarity index 100% rename from dist/components/segmentedControl/sp-segmented-control.d.ts rename to dist/src/components/segmentedControl/sp-segmented-control.d.ts diff --git a/dist/src/components/segmentedControl/sp-segmented-control.d.ts.map b/dist/src/components/segmentedControl/sp-segmented-control.d.ts.map new file mode 100644 index 0000000..c5fb2a9 --- /dev/null +++ b/dist/src/components/segmentedControl/sp-segmented-control.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-segmented-control.d.ts","sourceRoot":"","sources":["../../../../src/components/segmentedControl/sp-segmented-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAS/E,qBAAa,kBAAmB,SAAQ,sBAAsB;;CAW7D;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"} \ No newline at end of file diff --git a/dist/components/segmentedControl/sp-segmented-control.js b/dist/src/components/segmentedControl/sp-segmented-control.js similarity index 76% rename from dist/components/segmentedControl/sp-segmented-control.js rename to dist/src/components/segmentedControl/sp-segmented-control.js index 4f751f3..1559214 100644 --- a/dist/components/segmentedControl/sp-segmented-control.js +++ b/dist/src/components/segmentedControl/sp-segmented-control.js @@ -8,10 +8,12 @@ styles.replaceSync(`${foundationStyle} ${segmentedControlStyle}`); export class SpSegmentedControl extends UbRadioButtonTextGroup { constructor() { super(); - this.shadowRoot.adoptedStyleSheets = [ - ...this.shadowRoot.adoptedStyleSheets, - styles, - ]; + if (this.shadowRoot) { + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + } } } customElements.get("sp-segmented-control") || diff --git a/dist/src/components/tab/sp-tab.d.ts b/dist/src/components/tab/sp-tab.d.ts new file mode 100644 index 0000000..83125dd --- /dev/null +++ b/dist/src/components/tab/sp-tab.d.ts @@ -0,0 +1,26 @@ +type TabType = "tabWhite" | "tabGray"; +export declare class SpTab extends HTMLElement { + #private; + tabElement: HTMLButtonElement; + textElement: HTMLSpanElement; + set text(value: string); + get selected(): boolean; + set selected(value: boolean); + get disabled(): boolean; + set disabled(value: boolean); + get type(): TabType; + set type(value: TabType); + get createNewIcon(): boolean; + set createNewIcon(value: boolean); + static get observedAttributes(): string[]; + constructor(); + connectedCallback(): void; + attributeChangedCallback(name: string, oldValue: string, newValue: string): void; +} +declare global { + interface HTMLElementTagNameMap { + "sp-tab": SpTab; + } +} +export {}; +//# sourceMappingURL=sp-tab.d.ts.map \ No newline at end of file diff --git a/dist/src/components/tab/sp-tab.d.ts.map b/dist/src/components/tab/sp-tab.d.ts.map new file mode 100644 index 0000000..e354361 --- /dev/null +++ b/dist/src/components/tab/sp-tab.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sp-tab.d.ts","sourceRoot":"","sources":["../../../../src/components/tab/sp-tab.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAKtC,qBAAa,KAAM,SAAQ,WAAW;;IAMpC,UAAU,oBAAoC;IAC9C,WAAW,kBAAkC;IAE7C,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,QAAQ,IAGQ,OAAO,CAD1B;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IAED,IAAI,QAAQ,IAGQ,OAAO,CAD1B;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAK1B;IAED,IAAI,IAAI,IAGQ,OAAO,CADtB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,EAStB;IACD,IAAI,aAAa,IAGQ,OAAO,CAD/B;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAU/B;IAED,MAAM,KAAK,kBAAkB,aAE5B;;IAeD,iBAAiB;IAYjB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAiC1E;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,KAAK,CAAC;KACjB;CACF"} \ No newline at end of file diff --git a/dist/src/components/tab/sp-tab.js b/dist/src/components/tab/sp-tab.js new file mode 100644 index 0000000..482684a --- /dev/null +++ b/dist/src/components/tab/sp-tab.js @@ -0,0 +1,133 @@ +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var _SpTab_instances, _SpTab_selected, _SpTab_disabled, _SpTab_type, _SpTab_createNewIcon, _SpTab_createNewIconElement, _SpTab_onSelectedAdd, _SpTab_onSelectedRemove, _SpTab_tabDisabledUpdate; +// @ts-ignore +import foundationStyle from "../foundation.css?inline" assert { type: "css" }; +// @ts-ignore +import tabStyle from "./tab.css?inline" assert { type: "css" }; +import { SpIcon } from "../icon/sp-icon"; +const styles = new CSSStyleSheet(); +styles.replaceSync(`${foundationStyle} ${tabStyle}`); +export class SpTab extends HTMLElement { + set text(value) { + this.textElement.innerText = value; + } + get selected() { + return __classPrivateFieldGet(this, _SpTab_selected, "f"); + } + set selected(value) { + __classPrivateFieldSet(this, _SpTab_selected, value, "f"); + value ? __classPrivateFieldGet(this, _SpTab_instances, "m", _SpTab_onSelectedAdd).call(this) : __classPrivateFieldGet(this, _SpTab_instances, "m", _SpTab_onSelectedRemove).call(this); + } + get disabled() { + return __classPrivateFieldGet(this, _SpTab_disabled, "f"); + } + set disabled(value) { + const tab = this.tabElement; + __classPrivateFieldSet(this, _SpTab_disabled, value, "f"); + value ? tab.classList.add("isDisable") : tab.classList.remove("isDisable"); + __classPrivateFieldGet(this, _SpTab_instances, "m", _SpTab_tabDisabledUpdate).call(this); + } + get type() { + return __classPrivateFieldGet(this, _SpTab_type, "f"); + } + set type(value) { + const tab = this.tabElement; + const typeClassList = { + tabWhite: "-white", + tabGray: "-gray", + }; + tab.classList.remove(typeClassList[__classPrivateFieldGet(this, _SpTab_type, "f")]); + tab.classList.add(typeClassList[value]); + __classPrivateFieldSet(this, _SpTab_type, value, "f"); + } + get createNewIcon() { + return __classPrivateFieldGet(this, _SpTab_createNewIcon, "f"); + } + set createNewIcon(value) { + __classPrivateFieldSet(this, _SpTab_createNewIcon, value, "f"); + if (value === true) { + this.tabElement.insertBefore(__classPrivateFieldGet(this, _SpTab_createNewIconElement, "f"), this.textElement); + } + else { + __classPrivateFieldGet(this, _SpTab_createNewIconElement, "f").remove(); + } + } + static get observedAttributes() { + return ["text", "selected", "create-new-icon", "disabled", "type"]; + } + constructor() { + super(); + _SpTab_instances.add(this); + _SpTab_selected.set(this, void 0); + _SpTab_disabled.set(this, void 0); + _SpTab_type.set(this, void 0); + _SpTab_createNewIcon.set(this, void 0); + _SpTab_createNewIconElement.set(this, new SpIcon()); + this.tabElement = document.createElement("button"); + this.textElement = document.createElement("span"); + this.attachShadow({ mode: "open" }); + this.shadowRoot.adoptedStyleSheets = [ + ...this.shadowRoot.adoptedStyleSheets, + styles, + ]; + this.tabElement.classList.add("spds__tab"); + this.tabElement.setAttribute("role", "tab"); + this.tabElement.setAttribute("aria-tabindex", "0"); + this.textElement.classList.add("spds__tabText"); + this.tabElement.appendChild(this.textElement); + } + connectedCallback() { + __classPrivateFieldGet(this, _SpTab_createNewIconElement, "f").classList.add("base__icon"); + __classPrivateFieldGet(this, _SpTab_createNewIconElement, "f").size = "small"; + __classPrivateFieldGet(this, _SpTab_createNewIconElement, "f").type = "plus"; + if (typeof this.selected === "undefined") { + // this.selected = false; + this.tabElement.setAttribute("aria-selected", "false"); + } + if (typeof this.type === "undefined") + this.type = "tabWhite"; + this.setAttribute("role", "tablist"); + this.shadowRoot.appendChild(this.tabElement); + } + attributeChangedCallback(name, oldValue, newValue) { + if (oldValue === newValue) + return; + switch (name) { + case "text": + this.text = newValue; + break; + case "selected": + this.selected = newValue === "true" || newValue === ""; + break; + case "disabled": + this.disabled = newValue === "true" || newValue === ""; + break; + case "type": + this.type = newValue; + break; + case "create-new-icon": + this.createNewIcon = newValue === "true" || newValue === ""; + break; + } + } +} +_SpTab_selected = new WeakMap(), _SpTab_disabled = new WeakMap(), _SpTab_type = new WeakMap(), _SpTab_createNewIcon = new WeakMap(), _SpTab_createNewIconElement = new WeakMap(), _SpTab_instances = new WeakSet(), _SpTab_onSelectedAdd = function _SpTab_onSelectedAdd() { + this.tabElement.classList.add("-selected"); + this.tabElement.setAttribute("aria-selected", "true"); +}, _SpTab_onSelectedRemove = function _SpTab_onSelectedRemove() { + this.tabElement.classList.remove("-selected"); + this.tabElement.setAttribute("aria-selected", "false"); +}, _SpTab_tabDisabledUpdate = function _SpTab_tabDisabledUpdate() { + this.tabElement.disabled = this.disabled; +}; +customElements.get("sp-tab") || customElements.define("sp-tab", SpTab); diff --git a/dist/index.d.ts b/dist/src/index.d.ts similarity index 90% rename from dist/index.d.ts rename to dist/src/index.d.ts index 45caa6e..4292fac 100644 --- a/dist/index.d.ts +++ b/dist/src/index.d.ts @@ -4,4 +4,5 @@ export { SpCheckboxText } from "./components/checkbox/sp-checkbox-text"; export { SpCheckboxList } from "./components/checkbox/sp-checkbox-list"; export { SpIcon } from "./components/icon/sp-icon"; export { SpRadioButtonTextGroup } from "./components/radio/sp-radio-button-text-group"; +export { SpTab } from "./components/tab/sp-tab"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/index.d.ts.map b/dist/src/index.d.ts.map new file mode 100644 index 0000000..15a223f --- /dev/null +++ b/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC"} \ No newline at end of file diff --git a/dist/index.js b/dist/src/index.js similarity index 89% rename from dist/index.js rename to dist/src/index.js index 483aed7..5c52c9b 100644 --- a/dist/index.js +++ b/dist/src/index.js @@ -4,3 +4,4 @@ export { SpCheckboxText } from "./components/checkbox/sp-checkbox-text"; export { SpCheckboxList } from "./components/checkbox/sp-checkbox-list"; export { SpIcon } from "./components/icon/sp-icon"; export { SpRadioButtonTextGroup } from "./components/radio/sp-radio-button-text-group"; +export { SpTab } from "./components/tab/sp-tab"; diff --git a/dist/vitest.config.d.ts b/dist/vitest.config.d.ts new file mode 100644 index 0000000..2b17c25 --- /dev/null +++ b/dist/vitest.config.d.ts @@ -0,0 +1,3 @@ +declare const _default: import("vite").UserConfig; +export default _default; +//# sourceMappingURL=vitest.config.d.ts.map \ No newline at end of file diff --git a/dist/vitest.config.d.ts.map b/dist/vitest.config.d.ts.map new file mode 100644 index 0000000..7e07e0c --- /dev/null +++ b/dist/vitest.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAIG"} \ No newline at end of file diff --git a/dist/vitest.config.js b/dist/vitest.config.js new file mode 100644 index 0000000..0bc0e82 --- /dev/null +++ b/dist/vitest.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from "vitest/config"; +export default defineConfig({ + test: { + environment: "happy-dom", + }, +});