tuix-webcomponents 0.1.0 → 0.3.0
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/dist/src/index.d.ts +20 -0
- package/dist/src/index.js +13 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tuix-button/TuixBaseButton.d.ts +17 -0
- package/dist/src/tuix-button/TuixBaseButton.js +63 -0
- package/dist/src/tuix-button/TuixBaseButton.js.map +1 -0
- package/dist/src/tuix-button/TuixButton.d.ts +5 -12
- package/dist/src/tuix-button/TuixButton.js +16 -49
- package/dist/src/tuix-button/TuixButton.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.styles.d.ts +1 -0
- package/dist/src/tuix-button/TuixButton.styles.js +66 -36
- package/dist/src/tuix-button/TuixButton.styles.js.map +1 -1
- package/dist/src/tuix-button/enums/tuix-button.enums.js +3 -3
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +1 -1
- package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +1 -0
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js +2 -0
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js.map +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +15 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.js +96 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.js.map +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +4 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +117 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +1 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +21 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +24 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js.map +1 -0
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +5 -0
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +2 -0
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.d.ts +3 -1
- package/dist/src/tuix-dropdown/TuixDropdown.js +16 -6
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +1 -1
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +26 -11
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +1 -1
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +0 -6
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +0 -7
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +1 -1
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +4 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +1 -1
- package/dist/src/tuix-icon/TuixIcon.d.ts +2 -1
- package/dist/src/tuix-icon/TuixIcon.icons.js +6 -2
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +1 -1
- package/dist/src/tuix-icon/TuixIcon.js +10 -5
- package/dist/src/tuix-icon/TuixIcon.js.map +1 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +2 -21
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +1 -21
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +1 -1
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +6 -11
- package/dist/src/tuix-icon-button/TuixIconButton.js +13 -41
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +1 -1
- package/dist/src/tuix-input/TuixInput.d.ts +3 -2
- package/dist/src/tuix-input/TuixInput.js +28 -20
- package/dist/src/tuix-input/TuixInput.js.map +1 -1
- package/dist/src/tuix-input/TuixInput.styles.js +40 -28
- package/dist/src/tuix-input/TuixInput.styles.js.map +1 -1
- package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +10 -8
- package/dist/src/tuix-input/enums/tuix-input.enums.js +10 -10
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +1 -1
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +2 -0
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +1 -1
- package/dist/src/tuix-link/TuixLink.d.ts +2 -0
- package/dist/src/tuix-link/TuixLink.js +20 -8
- package/dist/src/tuix-link/TuixLink.js.map +1 -1
- package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +4 -4
- package/dist/src/tuix-link/enums/linkTarget.enum.js +4 -4
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +1 -1
- package/dist/src/tuix-paper/TuixPaper.d.ts +4 -2
- package/dist/src/tuix-paper/TuixPaper.js +23 -6
- package/dist/src/tuix-paper/TuixPaper.js.map +1 -1
- package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +6 -6
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +8 -8
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +1 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +16 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.js +87 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.js.map +1 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +5 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +130 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +1 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +3 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +2 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js.map +1 -0
- package/dist/src/tuix-text/TuixText.d.ts +5 -4
- package/dist/src/tuix-text/TuixText.js +17 -3
- package/dist/src/tuix-text/TuixText.js.map +1 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +11 -9
- package/dist/src/tuix-text/enums/tuix-text.enums.js +29 -11
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +1 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +13 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +77 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js.map +1 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +5 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +116 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +1 -0
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +2 -0
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +2 -0
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js.map +1 -0
- package/dist/src/utils/colors.d.ts +23 -11
- package/dist/src/utils/colors.js +25 -45
- package/dist/src/utils/colors.js.map +1 -1
- package/dist/src/utils/darkColors.d.ts +24 -1
- package/dist/src/utils/darkColors.js +25 -10
- package/dist/src/utils/darkColors.js.map +1 -1
- package/dist/src/utils/interfaces/detail-value.interface.d.ts +3 -0
- package/dist/src/utils/interfaces/detail-value.interface.js +2 -0
- package/dist/src/utils/interfaces/detail-value.interface.js.map +1 -0
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixInput.styles.js","sourceRoot":"","sources":["../../../src/tuix-input/TuixInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,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;eACpC,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC;;;CAGjD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;uCAOG,WAAW,CAAC,MAAM;;;;;;;;;;;;;;CAcxD,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBxC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { palette } from '../utils/colors';\nimport { darkPalette } from '../utils/darkColors';\nimport { hexToRgb } from '../utils/hex-rgb';\n\nconst inputVars = {\n gapX: '10px',\n iconDesktopSize: '1.5rem',\n iconTabletSize: '1rem',\n paddingX: '1.25rem',\n};\n\nconst rgbDarkValidation = hexToRgb(darkPalette.validation);\nconst rgbDarkError = hexToRgb(darkPalette.error);\n\nexport const hostStyles = css`\n :host {\n --t-field-color-form: ${unsafeCSS(palette.primary_50)};\n --t-field-color-title: ${unsafeCSS(palette.primary_300)};\n --t-field-color-text: ${unsafeCSS(palette.dark)};\n --t-field-color-description: ${unsafeCSS(palette.neutral_600)};\n --t-field-color-stroke-hover: ${unsafeCSS(palette.primary_300)};\n --t-field-color-stroke-focus: ${unsafeCSS(palette.main)};\n --t-field-color-text-disabled: ${unsafeCSS(palette.primary_300)};\n --t-field-color-stroke-validation: ${unsafeCSS(palette.validation_200)};\n --t-field-color-bg-validation: ${unsafeCSS(palette.validation_50)};\n --t-field-color-stroke-loading: ${unsafeCSS(palette.primary_300)};\n --t-field-color-bg-error: ${unsafeCSS(palette.error_50)};\n --t-field-color-stroke-error: ${unsafeCSS(palette.error_200)};\n --t-field-input-cursor: auto;\n }\n :host([dark]) {\n --t-field-color-form: ${unsafeCSS(darkPalette.primary_950)};\n --t-field-color-text: ${unsafeCSS(darkPalette.primary_100)};\n --t-field-color-description: ${unsafeCSS(darkPalette.neutral_200)};\n --t-field-color-stroke-focus: ${unsafeCSS(darkPalette.secondary)};\n --t-field-color-text-disabled: ${unsafeCSS(darkPalette.primary_800)};\n --t-field-color-stroke-validation: ${unsafeCSS(darkPalette.validation_200)};\n --t-field-color-bg-validation: rgba(\n ${rgbDarkValidation.r},\n ${rgbDarkValidation.g},\n ${rgbDarkValidation.b},\n 0.2\n );\n --t-field-color-bg-error: rgba(\n ${rgbDarkError.r},\n ${rgbDarkError.g},\n ${rgbDarkError.b},\n 0.2\n );\n --t-field-color-stroke-error: ${unsafeCSS(darkPalette.error_200)};\n }\n`;\n\nexport const inputComponentStyles = css`\n .t-input-container {\n position: relative;\n --t-padding-x-desktop-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconDesktopSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n --t-padding-x-tablet-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconTabletSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n }\n .t-input {\n padding: 1rem ${unsafeCSS(inputVars.paddingX)};\n border-radius: 4px;\n font-family: 'rubik', sans-serif;\n cursor: var(--t-field-input-cursor);\n }\n .t-input.with-title {\n padding-top: 1.5rem;\n padding-bottom: 0.5rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input {\n padding-top: 0.875rem;\n padding-bottom: 0.875rem;\n }\n .t-input.with-title {\n padding-top: 1.375rem;\n padding-bottom: 0.375rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n }\n .t-input.with-title {\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n`;\n\nexport const inputFontStyles = css`\n .t-input::placeholder,\n .t-input,\n .t-title {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input::placeholder {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input {\n font-size: 1rem;\n line-height: 1.25rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n font-size: 0.875rem;\n line-height: 1rem;\n }\n .t-input::placeholder {\n line-height: 1rem;\n }\n }\n`;\n\nexport const inputColorStyles = css`\n .t-input {\n background-color: var(--t-field-color-form);\n border: 1px solid var(--t-field-color-form);\n color: var(--t-field-color-text);\n }\n .t-input-container:hover .t-input,\n .t-input:hover {\n border: 1px solid var(--t-field-color-stroke-hover);\n }\n .t-input:focus {\n border: 1px solid var(--t-field-color-stroke-focus);\n outline: 1px solid var(--t-field-color-stroke-focus);\n }\n .t-input[disabled] {\n pointer-events: none;\n color: var(--t-field-color-text-disabled);\n }\n .t-input.with-title::placeholder {\n color: transparent;\n }\n .t-input::placeholder,\n .t-input.with-title:focus::placeholder {\n color: var(--t-field-color-title);\n }\n .t-input.with-warning {\n border: 1px solid var(--t-field-color-stroke-validation);\n background-color: var(--t-field-color-bg-validation);\n }\n .t-input.with-error {\n border: 1px solid var(--t-field-color-stroke-error);\n background-color: var(--t-field-color-bg-error);\n }\n .t-input.with-loading {\n border: 1px solid var(--t-field-color-stroke-loading);\n }\n`;\n\nexport const inputTitleStyles = css`\n .t-title {\n position: absolute;\n top: 50%;\n left: 1.25rem;\n font-family: 'rubik', sans-serif;\n color: var(--t-field-color-title);\n transform: translateY(-50%);\n transition-duration: 0.3s;\n pointer-events: none;\n }\n .t-textarea-container .t-title {\n top: 1rem;\n transform: none;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1rem;\n transform: translateY(0);\n top: 0.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-title {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.375rem;\n }\n .t-textarea-container .t-title {\n top: 0.875rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.25rem;\n }\n .t-textarea-container .t-title {\n top: 0.75rem;\n }\n }\n`;\n\nexport const inputIconStyles = css`\n .t-icon-set-container.t-icon-click {\n cursor: pointer;\n }\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconDesktopSize)};\n width: ${unsafeCSS(inputVars.iconDesktopSize)};\n }\n .t-input-container .t-icon-set-container.t-icon-right {\n position: absolute;\n top: 50%;\n right: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-input-container .t-icon-set-container.t-icon-left {\n position: absolute;\n top: 50%;\n left: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-icon-inactive {\n display: inline;\n }\n .t-icon-active {\n display: none;\n }\n .t-icon-disabled {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-inactive,\n .t-input:hover ~ .t-icon-set-container .t-icon-inactive,\n .t-input:focus ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-active,\n .t-input:hover ~ .t-icon-set-container .t-icon-active,\n .t-input:focus ~ .t-icon-set-container .t-icon-active {\n display: inline;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {\n display: inline;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconTabletSize)};\n width: ${unsafeCSS(inputVars.iconTabletSize)};\n }\n }\n`;\n\nexport const inputSearchStyles = css`\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-desktop-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-tablet-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-tablet-with-icon);\n }\n }\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n`;\n\nexport const inputDescriptionStyles = css`\n .t-input-description-container {\n margin-top: 0.5rem;\n font-family: 'rubik', sans-serif;\n font-size: 0.75rem;\n line-height: 1rem;\n color: var(--t-field-color-description);\n display: flex;\n justify-content: space-between;\n }\n .t-input-description-container .t-letter-counter {\n align-self: flex-end;\n }\n .t-input-description-container .t-input-description {\n display: flex;\n gap: 0.5rem;\n }\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"TuixInput.styles.js","sourceRoot":"","sources":["../../../src/tuix-input/TuixInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,MAAM;IACtB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF,MAAM,iBAAiB,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC3D,MAAM,YAAY,GAAG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WAAW,CAAC,MAAM;;;;;;;;;;;;;;CAcxD,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBxC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { Palette } from '../utils/colors';\nimport { DarkPalette } from '../utils/darkColors';\nimport { hexToRgb } from '../utils/hex-rgb';\n\nconst inputVars = {\n gapX: '10px',\n iconDesktopSize: '1.5rem',\n iconTabletSize: '1rem',\n paddingX: '1.25rem',\n};\n\nconst rgbDarkValidation = hexToRgb(DarkPalette.VALIDATION);\nconst rgbDarkError = hexToRgb(DarkPalette.ERROR);\n\nexport const hostStyles = css`\n :host {\n --t-field-color-form: ${unsafeCSS(Palette.PRIMARY_50)};\n --t-field-color-title: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-field-color-text: ${unsafeCSS(Palette.BLACK)};\n --t-field-color-description: ${unsafeCSS(Palette.NEUTRAL_600)};\n --t-field-color-stroke-hover: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-field-color-stroke-focus: ${unsafeCSS(Palette.MAIN)};\n --t-field-color-text-disabled: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-field-color-stroke-validation: ${unsafeCSS(Palette.VALIDATION_200)};\n --t-field-color-bg-validation: ${unsafeCSS(Palette.VALIDATION_50)};\n --t-field-color-stroke-loading: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-field-color-bg-error: ${unsafeCSS(Palette.ERROR_50)};\n --t-field-color-stroke-error: ${unsafeCSS(Palette.ERROR_200)};\n --t-field-input-cursor: auto;\n }\n :host([dark]) {\n --t-field-color-form: ${unsafeCSS(DarkPalette.PRIMARY_950)};\n --t-field-color-text: ${unsafeCSS(DarkPalette.PRIMARY_100)};\n --t-field-color-description: ${unsafeCSS(DarkPalette.NEUTRAL_200)};\n --t-field-color-stroke-focus: ${unsafeCSS(DarkPalette.SECONDARY)};\n --t-field-color-text-disabled: ${unsafeCSS(DarkPalette.PRIMARY_800)};\n --t-field-color-stroke-validation: ${unsafeCSS(DarkPalette.VALIDATION_200)};\n --t-field-color-bg-validation: rgba(\n ${rgbDarkValidation.r},\n ${rgbDarkValidation.g},\n ${rgbDarkValidation.b},\n 0.2\n );\n --t-field-color-bg-error: rgba(\n ${rgbDarkError.r},\n ${rgbDarkError.g},\n ${rgbDarkError.b},\n 0.2\n );\n --t-field-color-stroke-error: ${unsafeCSS(DarkPalette.ERROR_200)};\n }\n`;\n\nexport const inputComponentStyles = css`\n .t-input-container {\n position: relative;\n --t-padding-x-desktop-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconDesktopSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n --t-padding-x-tablet-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconTabletSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n }\n .t-input {\n padding: 1rem ${unsafeCSS(inputVars.paddingX)};\n border-radius: 4px;\n font-family: 'rubik', sans-serif;\n cursor: var(--t-field-input-cursor);\n width: 100%;\n box-sizing: border-box;\n }\n .t-input.with-title {\n padding-top: 1.5rem;\n padding-bottom: 0.5rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input {\n padding-top: 0.875rem;\n padding-bottom: 0.875rem;\n }\n .t-input.with-title {\n padding-top: 1.375rem;\n padding-bottom: 0.375rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n }\n .t-input.with-title {\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n`;\n\nexport const inputFontStyles = css`\n .t-input::placeholder,\n .t-input,\n .t-title {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input::placeholder {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input {\n font-size: 1rem;\n line-height: 1.25rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n font-size: 0.875rem;\n line-height: 1rem;\n }\n .t-input::placeholder {\n line-height: 1rem;\n }\n }\n`;\n\nexport const inputColorStyles = css`\n .t-input {\n background-color: var(--t-field-color-form);\n border: 1px solid var(--t-field-color-form);\n color: var(--t-field-color-text);\n }\n .t-input-container:hover .t-input,\n .t-input:hover {\n border: 1px solid var(--t-field-color-stroke-hover);\n }\n .t-input:focus {\n border: 1px solid var(--t-field-color-stroke-focus);\n outline: 1px solid var(--t-field-color-stroke-focus);\n }\n .t-input[disabled]:disabled {\n cursor: not-allowed;\n border: none;\n color: var(--t-field-color-text-disabled);\n }\n .t-input.with-title::placeholder {\n color: transparent;\n }\n .t-input::placeholder,\n .t-input.with-title:focus::placeholder {\n color: var(--t-field-color-title);\n }\n .t-input.with-warning {\n border: 1px solid var(--t-field-color-stroke-validation);\n background-color: var(--t-field-color-bg-validation);\n }\n .t-input.with-error {\n border: 1px solid var(--t-field-color-stroke-error);\n background-color: var(--t-field-color-bg-error);\n }\n .t-input.with-loading {\n border: 1px solid var(--t-field-color-stroke-loading);\n }\n`;\n\nexport const inputTitleStyles = css`\n .t-title {\n position: absolute;\n top: 50%;\n left: 1.25rem;\n font-family: 'rubik', sans-serif;\n color: var(--t-field-color-title);\n transform: translateY(-50%);\n transition-duration: 0.3s;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n .t-textarea-container .t-title {\n top: 1rem;\n transform: none;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1rem;\n transform: translateY(0);\n top: 0.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-title {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.375rem;\n }\n .t-textarea-container .t-title {\n top: 0.875rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.25rem;\n }\n .t-textarea-container .t-title {\n top: 0.75rem;\n }\n }\n`;\n\nexport const inputIconStyles = css`\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconDesktopSize)};\n width: ${unsafeCSS(inputVars.iconDesktopSize)};\n cursor: var(--t-field-input-cursor);\n }\n .t-icon-set-container.t-icon-click {\n cursor: pointer;\n }\n .t-input-container .t-icon-set-container.t-icon-right {\n position: absolute;\n top: 50%;\n right: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-input-container .t-icon-set-container.t-icon-left {\n position: absolute;\n top: 50%;\n left: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-icon-inactive {\n display: inline;\n }\n .t-icon-active {\n display: none;\n }\n .t-icon-disabled {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-inactive,\n .t-input:hover ~ .t-icon-set-container .t-icon-inactive,\n .t-input:focus ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-active,\n .t-input:hover ~ .t-icon-set-container .t-icon-active,\n .t-input:focus ~ .t-icon-set-container .t-icon-active {\n display: inline;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-active {\n display: none;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {\n display: inline;\n cursor: not-allowed;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconTabletSize)};\n width: ${unsafeCSS(inputVars.iconTabletSize)};\n }\n }\n`;\n\nexport const inputSearchStyles = css`\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-desktop-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-tablet-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-tablet-with-icon);\n }\n }\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n`;\n\nexport const inputDescriptionStyles = css`\n .t-input-description-container {\n margin-top: 0.5rem;\n font-family: 'rubik', sans-serif;\n font-size: 0.75rem;\n line-height: 1rem;\n color: var(--t-field-color-description);\n display: flex;\n justify-content: space-between;\n }\n .t-input-description-container .t-letter-counter {\n align-self: flex-end;\n }\n .t-input-description-container .t-input-description {\n display: flex;\n gap: 0.5rem;\n }\n`;\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
+
import { Palette } from '../../utils/colors';
|
|
3
|
+
import { DarkPalette } from '../../utils/darkColors';
|
|
2
4
|
export declare enum InputType {
|
|
3
5
|
TEXT = "text",
|
|
4
6
|
SEARCH = "search",
|
|
@@ -23,14 +25,14 @@ export declare const IconByDescriptionType: {
|
|
|
23
25
|
loading: IconName;
|
|
24
26
|
};
|
|
25
27
|
export declare const IconDescriptionColorLight: {
|
|
26
|
-
warning:
|
|
27
|
-
error:
|
|
28
|
-
success:
|
|
29
|
-
loading:
|
|
28
|
+
warning: Palette;
|
|
29
|
+
error: Palette;
|
|
30
|
+
success: Palette;
|
|
31
|
+
loading: Palette;
|
|
30
32
|
};
|
|
31
33
|
export declare const IconDescriptionColorDark: {
|
|
32
|
-
warning:
|
|
33
|
-
error:
|
|
34
|
-
success:
|
|
35
|
-
loading:
|
|
34
|
+
warning: DarkPalette;
|
|
35
|
+
error: DarkPalette;
|
|
36
|
+
success: DarkPalette;
|
|
37
|
+
loading: DarkPalette;
|
|
36
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Palette } from '../../utils/colors';
|
|
3
|
+
import { DarkPalette } from '../../utils/darkColors';
|
|
4
4
|
export var InputType;
|
|
5
5
|
(function (InputType) {
|
|
6
6
|
InputType["TEXT"] = "text";
|
|
@@ -28,15 +28,15 @@ export const IconByDescriptionType = {
|
|
|
28
28
|
[DescriptionType.LOADING]: IconName.LOADER,
|
|
29
29
|
};
|
|
30
30
|
export const IconDescriptionColorLight = {
|
|
31
|
-
[DescriptionType.WARNING]:
|
|
32
|
-
[DescriptionType.ERROR]:
|
|
33
|
-
[DescriptionType.SUCCESS]:
|
|
34
|
-
[DescriptionType.LOADING]:
|
|
31
|
+
[DescriptionType.WARNING]: Palette.VALIDATION,
|
|
32
|
+
[DescriptionType.ERROR]: Palette.ERROR,
|
|
33
|
+
[DescriptionType.SUCCESS]: Palette.SUCCESS,
|
|
34
|
+
[DescriptionType.LOADING]: Palette.PRIMARY_300,
|
|
35
35
|
};
|
|
36
36
|
export const IconDescriptionColorDark = {
|
|
37
|
-
[DescriptionType.WARNING]:
|
|
38
|
-
[DescriptionType.ERROR]:
|
|
39
|
-
[DescriptionType.SUCCESS]:
|
|
40
|
-
[DescriptionType.LOADING]:
|
|
37
|
+
[DescriptionType.WARNING]: DarkPalette.VALIDATION,
|
|
38
|
+
[DescriptionType.ERROR]: DarkPalette.ERROR,
|
|
39
|
+
[DescriptionType.SUCCESS]: DarkPalette.SUCCESS,
|
|
40
|
+
[DescriptionType.LOADING]: DarkPalette.PRIMARY_300,
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=tuix-input.enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-input.enums.js","sourceRoot":"","sources":["../../../../src/tuix-input/enums/tuix-input.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,mCAAsB,CAAA;AACxB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,oCAAe,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,oBAAoB;IACxD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,YAAY;IAChD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU;IAC7C,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU;IACjD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;IAC9C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW;CACnD,CAAC","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport {
|
|
1
|
+
{"version":3,"file":"tuix-input.enums.js","sourceRoot":"","sources":["../../../../src/tuix-input/enums/tuix-input.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,mCAAsB,CAAA;AACxB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,oCAAe,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,oBAAoB;IACxD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,YAAY;IAChD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU;IAC7C,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU;IACjD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;IAC9C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW;CACnD,CAAC","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { Palette } from '../../utils/colors';\nimport { DarkPalette } from '../../utils/darkColors';\n\nexport enum InputType {\n TEXT = 'text',\n SEARCH = 'search',\n PASSWORD = 'password',\n TEXT_AREA = 'textarea',\n}\n\nexport enum InputIconLocation {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport enum DescriptionType {\n TEXT = 'text',\n WARNING = 'warning',\n ERROR = 'error',\n SUCCESS = 'success',\n LOADING = 'loading',\n}\n\nexport const IconByDescriptionType = {\n [DescriptionType.WARNING]: IconName.TRIANGLE_EXCLAMATION,\n [DescriptionType.ERROR]: IconName.CIRCLE_X,\n [DescriptionType.SUCCESS]: IconName.CIRCLE_CHECK,\n [DescriptionType.LOADING]: IconName.LOADER,\n};\n\nexport const IconDescriptionColorLight = {\n [DescriptionType.WARNING]: Palette.VALIDATION,\n [DescriptionType.ERROR]: Palette.ERROR,\n [DescriptionType.SUCCESS]: Palette.SUCCESS,\n [DescriptionType.LOADING]: Palette.PRIMARY_300,\n};\n\nexport const IconDescriptionColorDark = {\n [DescriptionType.WARNING]: DarkPalette.VALIDATION,\n [DescriptionType.ERROR]: DarkPalette.ERROR,\n [DescriptionType.SUCCESS]: DarkPalette.SUCCESS,\n [DescriptionType.LOADING]: DarkPalette.PRIMARY_300,\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
+
import { DetailValue } from '../../utils/interfaces/detail-value.interface';
|
|
2
3
|
import { InputIconLocation } from '../enums/tuix-input.enums';
|
|
3
4
|
export interface InputIconColors {
|
|
4
5
|
inactive: string;
|
|
@@ -11,3 +12,4 @@ export interface FormatIconSetParams {
|
|
|
11
12
|
location?: InputIconLocation;
|
|
12
13
|
clickHandler?: (e: MouseEvent) => void;
|
|
13
14
|
}
|
|
15
|
+
export type CustomEventTuixInput = CustomEvent<DetailValue<string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-input.interface.js","sourceRoot":"","sources":["../../../../src/tuix-input/interfaces/tuix-input.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { InputIconLocation } from '../enums/tuix-input.enums';\n\nexport interface InputIconColors {\n inactive: string;\n active: string;\n disabled: string;\n}\n\nexport interface FormatIconSetParams {\n iconName: IconName;\n colorByState: InputIconColors;\n location?: InputIconLocation;\n clickHandler?: (e: MouseEvent) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tuix-input.interface.js","sourceRoot":"","sources":["../../../../src/tuix-input/interfaces/tuix-input.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { DetailValue } from '../../utils/interfaces/detail-value.interface';\nimport { InputIconLocation } from '../enums/tuix-input.enums';\n\nexport interface InputIconColors {\n inactive: string;\n active: string;\n disabled: string;\n}\n\nexport interface FormatIconSetParams {\n iconName: IconName;\n colorByState: InputIconColors;\n location?: InputIconLocation;\n clickHandler?: (e: MouseEvent) => void;\n}\n\nexport type CustomEventTuixInput = CustomEvent<DetailValue<string>>;\n"]}
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, LitElement, unsafeCSS } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
4
|
+
import { Palette } from '../utils/colors';
|
|
5
5
|
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
6
6
|
import { MainVariant } from '../utils/mainVariant.enum';
|
|
7
7
|
import { LinkTarget } from './enums/linkTarget.enum';
|
|
8
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
8
9
|
let TuixLink = class TuixLink extends LitElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this.href = '';
|
|
12
|
-
this.target = LinkTarget.
|
|
13
|
+
this.target = LinkTarget.BLANK;
|
|
13
14
|
this.variant = MainVariant.PRIMARY;
|
|
14
15
|
this.disabled = false;
|
|
16
|
+
this.dark = false;
|
|
17
|
+
}
|
|
18
|
+
_getOptionalClasses() {
|
|
19
|
+
return {
|
|
20
|
+
link: true,
|
|
21
|
+
disabled: this.disabled,
|
|
22
|
+
[MainVariant.SECONDARY]: this.dark || this.variant === MainVariant.SECONDARY,
|
|
23
|
+
};
|
|
15
24
|
}
|
|
16
25
|
render() {
|
|
17
26
|
return html `
|
|
18
27
|
<a
|
|
19
|
-
target="${this.disabled ? LinkTarget.
|
|
20
|
-
class="
|
|
28
|
+
target="${this.disabled ? LinkTarget.SELF : this.target}"
|
|
29
|
+
class="${classMap(this._getOptionalClasses())}"
|
|
21
30
|
href="${this.disabled ? 'javascript:void(0)' : this.href}"
|
|
22
31
|
>
|
|
23
32
|
<slot></slot>
|
|
@@ -32,13 +41,13 @@ TuixLink.styles = css `
|
|
|
32
41
|
font-weight: 400;
|
|
33
42
|
line-height: 1.25rem;
|
|
34
43
|
text-decoration: none;
|
|
35
|
-
color: ${unsafeCSS(
|
|
44
|
+
color: ${unsafeCSS(Palette.MAIN)};
|
|
36
45
|
}
|
|
37
46
|
a.link:hover {
|
|
38
47
|
text-decoration: underline;
|
|
39
48
|
}
|
|
40
49
|
a.link.secondary {
|
|
41
|
-
color: ${unsafeCSS(
|
|
50
|
+
color: ${unsafeCSS(Palette.WHITE)};
|
|
42
51
|
}
|
|
43
52
|
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
44
53
|
a.link {
|
|
@@ -49,7 +58,7 @@ TuixLink.styles = css `
|
|
|
49
58
|
}
|
|
50
59
|
a.link.disabled {
|
|
51
60
|
text-decoration: underline;
|
|
52
|
-
color: ${unsafeCSS(
|
|
61
|
+
color: ${unsafeCSS(Palette.PRIMARY_300)};
|
|
53
62
|
cursor: not-allowed;
|
|
54
63
|
}
|
|
55
64
|
`;
|
|
@@ -63,8 +72,11 @@ __decorate([
|
|
|
63
72
|
property({ type: MainVariant })
|
|
64
73
|
], TuixLink.prototype, "variant", void 0);
|
|
65
74
|
__decorate([
|
|
66
|
-
property({ type: Boolean })
|
|
75
|
+
property({ type: Boolean, reflect: true })
|
|
67
76
|
], TuixLink.prototype, "disabled", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: Boolean, reflect: true })
|
|
79
|
+
], TuixLink.prototype, "dark", void 0);
|
|
68
80
|
TuixLink = __decorate([
|
|
69
81
|
customElement('tuix-link')
|
|
70
82
|
], TuixLink);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixLink.js","sourceRoot":"","sources":["../../../src/tuix-link/TuixLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"TuixLink.js","sourceRoot":"","sources":["../../../src/tuix-link/TuixLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGlE,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAAxC;;QA+BE,SAAI,GAAG,EAAE,CAAC;QAGV,WAAM,GAAG,UAAU,C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E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAC9B;AA3CF,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAiEpB;SAjEY,QAAQ","sourcesContent":["import { html, css, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { Palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { LinkTarget } from './enums/linkTarget.enum';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\n\n@customElement('tuix-link')\nexport class TuixLink extends LitElement {\n static styles = css`\n a.link {\n font-family: 'rubik', sans-serif;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.25rem;\n text-decoration: none;\n color: ${unsafeCSS(Palette.MAIN)};\n }\n a.link:hover {\n text-decoration: underline;\n }\n a.link.secondary {\n color: ${unsafeCSS(Palette.WHITE)};\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n a.link {\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1rem;\n }\n }\n a.link.disabled {\n text-decoration: underline;\n color: ${unsafeCSS(Palette.PRIMARY_300)};\n cursor: not-allowed;\n }\n `;\n\n @property({ type: String })\n href = '';\n\n @property({ type: LinkTarget })\n target = LinkTarget.BLANK;\n\n @property({ type: MainVariant })\n variant = MainVariant.PRIMARY;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n private _getOptionalClasses(): ClassInfo {\n return {\n link: true,\n disabled: this.disabled,\n [MainVariant.SECONDARY]:\n this.dark || this.variant === MainVariant.SECONDARY,\n };\n }\n\n render() {\n return html`\n <a\n target=\"${this.disabled ? LinkTarget.SELF : this.target}\"\n class=\"${classMap(this._getOptionalClasses())}\"\n href=\"${this.disabled ? 'javascript:void(0)' : this.href}\"\n >\n <slot></slot>\n </a>\n `;\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export var LinkTarget;
|
|
2
2
|
(function (LinkTarget) {
|
|
3
|
-
LinkTarget["
|
|
4
|
-
LinkTarget["
|
|
5
|
-
LinkTarget["
|
|
6
|
-
LinkTarget["
|
|
3
|
+
LinkTarget["BLANK"] = "_blank";
|
|
4
|
+
LinkTarget["SELF"] = "_self";
|
|
5
|
+
LinkTarget["PARENT"] = "_parent";
|
|
6
|
+
LinkTarget["TOP"] = "_top";
|
|
7
7
|
})(LinkTarget || (LinkTarget = {}));
|
|
8
8
|
//# sourceMappingURL=linkTarget.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkTarget.enum.js","sourceRoot":"","sources":["../../../../src/tuix-link/enums/linkTarget.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAAgB,CAAA;IAChB,4BAAc,CAAA;IACd,gCAAkB,CAAA;IAClB,0BAAY,CAAA;AACd,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["export enum LinkTarget {\n
|
|
1
|
+
{"version":3,"file":"linkTarget.enum.js","sourceRoot":"","sources":["../../../../src/tuix-link/enums/linkTarget.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAAgB,CAAA;IAChB,4BAAc,CAAA;IACd,gCAAkB,CAAA;IAClB,0BAAY,CAAA;AACd,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["export enum LinkTarget {\n BLANK = '_blank',\n SELF = '_self',\n PARENT = '_parent',\n TOP = '_top',\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { PaperVariant } from './enums/tuix-paper.enum';
|
|
3
3
|
export declare class TuixPaper extends LitElement {
|
|
4
|
-
elevation:
|
|
4
|
+
elevation: PaperVariant;
|
|
5
|
+
dark: boolean;
|
|
5
6
|
static styles: import("lit").CSSResult;
|
|
7
|
+
private _getOptionalClasses;
|
|
6
8
|
render(): TemplateResult;
|
|
7
9
|
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, css, html, unsafeCSS } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PaperVariant } from './enums/tuix-paper.enum';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
6
|
let TuixPaper = class TuixPaper extends LitElement {
|
|
6
7
|
constructor() {
|
|
7
8
|
super(...arguments);
|
|
8
|
-
this.elevation =
|
|
9
|
+
this.elevation = PaperVariant.VARIANT_1;
|
|
10
|
+
this.dark = false;
|
|
11
|
+
}
|
|
12
|
+
_getOptionalClasses() {
|
|
13
|
+
const elevationClass = `elevation `;
|
|
14
|
+
const variantClass = `variant_${this.elevation}`;
|
|
15
|
+
const darkClass = `dark_${this.elevation}`;
|
|
16
|
+
return {
|
|
17
|
+
[elevationClass]: true,
|
|
18
|
+
[variantClass]: !this.dark,
|
|
19
|
+
[darkClass]: this.dark,
|
|
20
|
+
};
|
|
9
21
|
}
|
|
10
22
|
render() {
|
|
11
|
-
return html ` <div class="
|
|
23
|
+
return html ` <div class="${classMap(this._getOptionalClasses())}">
|
|
12
24
|
<slot></slot>
|
|
13
25
|
</div>`;
|
|
14
26
|
}
|
|
@@ -17,22 +29,27 @@ let TuixPaper = class TuixPaper extends LitElement {
|
|
|
17
29
|
TuixPaper.styles = css `
|
|
18
30
|
.elevation {
|
|
19
31
|
border-radius: 20px;
|
|
20
|
-
padding: 16px 32px;
|
|
21
32
|
}
|
|
22
33
|
|
|
23
|
-
${unsafeCSS(Object.values(
|
|
34
|
+
${unsafeCSS(Object.values(PaperVariant).slice(1)
|
|
24
35
|
.map((variant, index) => {
|
|
25
36
|
return `
|
|
26
37
|
.elevation.variant_${variant} {
|
|
27
38
|
box-shadow: 0px ${Math.pow(2, index)}px ${Math.pow(2, (index + 2))}px rgba(66, 79, 101, 0.16);
|
|
28
39
|
}
|
|
40
|
+
.elevation.dark_${variant} {
|
|
41
|
+
background-color: ${unsafeCSS(`rgb(${23 + 3 * (index)}, ${23 + 3 * (index)}, ${26 + 5 * (index)})`)};
|
|
42
|
+
}
|
|
29
43
|
`;
|
|
30
44
|
})
|
|
31
45
|
.join('\n'))}
|
|
32
46
|
`;
|
|
33
47
|
__decorate([
|
|
34
|
-
property({ type:
|
|
48
|
+
property({ type: PaperVariant })
|
|
35
49
|
], TuixPaper.prototype, "elevation", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: Boolean, reflect: true })
|
|
52
|
+
], TuixPaper.prototype, "dark", void 0);
|
|
36
53
|
TuixPaper = __decorate([
|
|
37
54
|
customElement('tuix-paper')
|
|
38
55
|
], TuixPaper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixPaper.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TuixPaper.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGlE,IAAa,SAAS,GAAtB,MAAa,SA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AAE,YAAY,EAAE,CAAC;4CACE;AAGnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC9B;AALF,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA6CrB;SA7CY,SAAS","sourcesContent":["import { LitElement, TemplateResult, css, html, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { PaperVariant } from './enums/tuix-paper.enum';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\n\n@customElement('tuix-paper')\nexport class TuixPaper extends LitElement {\n @property({ type: PaperVariant })\n elevation = PaperVariant.VARIANT_1;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n // prettier-ignore\n static styles = css`\n .elevation {\n border-radius: 20px;\n }\n\n ${unsafeCSS(\n Object.values(PaperVariant).slice(1)\n .map((variant, index) => {\n return `\n .elevation.variant_${variant} {\n box-shadow: 0px ${Math.pow(2, index)}px ${Math.pow(2, (index + 2))}px rgba(66, 79, 101, 0.16);\n }\n .elevation.dark_${variant} {\n background-color: ${unsafeCSS(`rgb(${23 + 3*(index)}, ${23 + 3*(index)}, ${26 + 5*(index)})`)};\n }\n `;\n })\n .join('\\n')\n )}\n `;\n\n private _getOptionalClasses(): ClassInfo {\n const elevationClass = `elevation `;\n const variantClass = `variant_${this.elevation}`;\n const darkClass = `dark_${this.elevation}`;\n return {\n [elevationClass]: true,\n [variantClass]: !this.dark,\n [darkClass]: this.dark,\n };\n }\n\n render(): TemplateResult {\n return html` <div class=\"${classMap(this._getOptionalClasses())}\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export declare enum PaperVariant {
|
|
2
|
+
VARIANT_0 = "0",
|
|
3
|
+
VARIANT_1 = "1",
|
|
4
|
+
VARIANT_2 = "2",
|
|
5
|
+
VARIANT_3 = "3",
|
|
6
|
+
VARIANT_4 = "4"
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(
|
|
1
|
+
export var PaperVariant;
|
|
2
|
+
(function (PaperVariant) {
|
|
3
|
+
PaperVariant["VARIANT_0"] = "0";
|
|
4
|
+
PaperVariant["VARIANT_1"] = "1";
|
|
5
|
+
PaperVariant["VARIANT_2"] = "2";
|
|
6
|
+
PaperVariant["VARIANT_3"] = "3";
|
|
7
|
+
PaperVariant["VARIANT_4"] = "4";
|
|
8
|
+
})(PaperVariant || (PaperVariant = {}));
|
|
9
9
|
//# sourceMappingURL=tuix-paper.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-paper.enum.js","sourceRoot":"","sources":["../../../../src/tuix-paper/enums/tuix-paper.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"tuix-paper.enum.js","sourceRoot":"","sources":["../../../../src/tuix-paper/enums/tuix-paper.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;AACjB,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB","sourcesContent":["export enum PaperVariant {\n VARIANT_0 = '0',\n VARIANT_1 = '1',\n VARIANT_2 = '2',\n VARIANT_3 = '3',\n VARIANT_4 = '4',\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { CheckboxLabelSide } from '../tuix-checkbox/enums/tuix-checkbox.enums';
|
|
3
|
+
import { TuixRadioButtonOption } from './interfaces/tuix-radio-button.interface';
|
|
4
|
+
export declare class TuixRadioButton extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
dark: boolean;
|
|
8
|
+
error: boolean;
|
|
9
|
+
options: TuixRadioButtonOption[];
|
|
10
|
+
labelSide: CheckboxLabelSide;
|
|
11
|
+
selectedOption: TuixRadioButtonOption | null;
|
|
12
|
+
private _onRadioButtonChange;
|
|
13
|
+
private _getFullContainerClasses;
|
|
14
|
+
private _formatTemplate;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { CheckboxLabelSide } from '../tuix-checkbox/enums/tuix-checkbox.enums';
|
|
6
|
+
import { radioButtonContainerStyles, radioButtonInnerStyles, radioButtonLabelStyles, radioButtonStyles, radioHostStyles, } from './TuixRadioButton.styles';
|
|
7
|
+
let TuixRadioButton = class TuixRadioButton extends LitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.disabled = false;
|
|
11
|
+
this.dark = false;
|
|
12
|
+
this.error = false;
|
|
13
|
+
this.options = [];
|
|
14
|
+
this.labelSide = CheckboxLabelSide.RIGHT;
|
|
15
|
+
this.selectedOption = null;
|
|
16
|
+
}
|
|
17
|
+
_onRadioButtonChange(event) {
|
|
18
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
19
|
+
detail: {
|
|
20
|
+
value: event.target.value,
|
|
21
|
+
},
|
|
22
|
+
bubbles: true,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
_getFullContainerClasses() {
|
|
26
|
+
return {
|
|
27
|
+
't-radio-button-full-container': true,
|
|
28
|
+
't-with-error': this.error && !this.disabled,
|
|
29
|
+
't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,
|
|
30
|
+
't-multiple-options': this.options.length > 1,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
_formatTemplate(option, index) {
|
|
34
|
+
return html `<label class="${classMap(this._getFullContainerClasses())}">
|
|
35
|
+
<div class="t-radio-button-container">
|
|
36
|
+
<input
|
|
37
|
+
type="radio"
|
|
38
|
+
class="t-radio-button"
|
|
39
|
+
?disabled="${this.disabled}"
|
|
40
|
+
.value="${option}"
|
|
41
|
+
name="tuix-radio-button"
|
|
42
|
+
?checked="${this.selectedOption === option}"
|
|
43
|
+
@change="${this._onRadioButtonChange}"
|
|
44
|
+
/>
|
|
45
|
+
<div class="t-radio-button-checkmark">
|
|
46
|
+
<div class="t-radio-button-inner"></div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="t-radio-button-label">
|
|
50
|
+
<slot name="label-${index}">${option}</slot>
|
|
51
|
+
</div>
|
|
52
|
+
</label>`;
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return html `${this.options.map((option, index) => this._formatTemplate(option, index))}`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
TuixRadioButton.styles = [
|
|
59
|
+
radioHostStyles,
|
|
60
|
+
radioButtonContainerStyles,
|
|
61
|
+
radioButtonStyles,
|
|
62
|
+
radioButtonInnerStyles,
|
|
63
|
+
radioButtonLabelStyles,
|
|
64
|
+
];
|
|
65
|
+
__decorate([
|
|
66
|
+
property({ type: Boolean, reflect: true })
|
|
67
|
+
], TuixRadioButton.prototype, "disabled", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
property({ type: Boolean, reflect: true })
|
|
70
|
+
], TuixRadioButton.prototype, "dark", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
property({ type: Boolean, reflect: true })
|
|
73
|
+
], TuixRadioButton.prototype, "error", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ type: Array })
|
|
76
|
+
], TuixRadioButton.prototype, "options", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: String })
|
|
79
|
+
], TuixRadioButton.prototype, "labelSide", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: String })
|
|
82
|
+
], TuixRadioButton.prototype, "selectedOption", void 0);
|
|
83
|
+
TuixRadioButton = __decorate([
|
|
84
|
+
customElement('tuix-radio-button')
|
|
85
|
+
], TuixRadioButton);
|
|
86
|
+
export { TuixRadioButton };
|
|
87
|
+
//# sourceMappingURL=TuixRadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixRadioButton.js","sourceRoot":"","sources":["../../../src/tuix-radio-button/TuixRadioButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAIlC,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,UAAU;IAA/C;;QAUE,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAG,KAAK,CAAC;QAGb,UAAK,GAAG,KAAK,CAAC;QAGd,YAAO,GAA4B,EAAE,CAAC;QAGtC,cAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAGpC,mBAAc,GAAiC,IAAI,CAAC;IAiDtD,CAAC;IA/CS,oBAAoB,CAAC,KAAiB;QAC5C,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KA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EAAE,CAAC;8CAC7B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDACY;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACS;AAGpC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDACyB;AAzBzC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA0E3B;SA1EY,eAAe","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { CheckboxLabelSide } from '../tuix-checkbox/enums/tuix-checkbox.enums';\nimport {\n radioButtonContainerStyles,\n radioButtonInnerStyles,\n radioButtonLabelStyles,\n radioButtonStyles,\n radioHostStyles,\n} from './TuixRadioButton.styles';\nimport { TuixRadioButtonOption } from './interfaces/tuix-radio-button.interface';\n\n@customElement('tuix-radio-button')\nexport class TuixRadioButton extends LitElement {\n static styles = [\n radioHostStyles,\n radioButtonContainerStyles,\n radioButtonStyles,\n radioButtonInnerStyles,\n radioButtonLabelStyles,\n ];\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n @property({ type: Boolean, reflect: true })\n error = false;\n\n @property({ type: Array })\n options: TuixRadioButtonOption[] = [];\n\n @property({ type: String })\n labelSide = CheckboxLabelSide.RIGHT;\n\n @property({ type: String })\n selectedOption: TuixRadioButtonOption | null = null;\n\n private _onRadioButtonChange(event: InputEvent) {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n value: (event.target as HTMLInputElement).value,\n },\n bubbles: true,\n })\n );\n }\n\n private _getFullContainerClasses(): ClassInfo {\n return {\n 't-radio-button-full-container': true,\n 't-with-error': this.error && !this.disabled,\n 't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,\n 't-multiple-options': this.options.length > 1,\n };\n }\n\n private _formatTemplate(option: TuixRadioButtonOption, index: number) {\n return html`<label class=\"${classMap(this._getFullContainerClasses())}\">\n <div class=\"t-radio-button-container\">\n <input\n type=\"radio\"\n class=\"t-radio-button\"\n ?disabled=\"${this.disabled}\"\n .value=\"${option}\"\n name=\"tuix-radio-button\"\n ?checked=\"${this.selectedOption === option}\"\n @change=\"${this._onRadioButtonChange}\"\n />\n <div class=\"t-radio-button-checkmark\">\n <div class=\"t-radio-button-inner\"></div>\n </div>\n </div>\n <div class=\"t-radio-button-label\">\n <slot name=\"label-${index}\">${option}</slot>\n </div>\n </label>`;\n }\n\n render() {\n return html`${this.options.map((option, index) =>\n this._formatTemplate(option, index)\n )}`;\n }\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const radioHostStyles: import("lit").CSSResult;
|
|
2
|
+
export declare const radioButtonContainerStyles: import("lit").CSSResult;
|
|
3
|
+
export declare const radioButtonStyles: import("lit").CSSResult;
|
|
4
|
+
export declare const radioButtonInnerStyles: import("lit").CSSResult;
|
|
5
|
+
export declare const radioButtonLabelStyles: import("lit").CSSResult;
|