@paperless/core 2.0.1-beta.43 → 2.0.1-beta.45
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/CHANGELOG.md +22 -0
- package/dist/build/{p-d6bda000.entry.js → p-146bb45f.entry.js} +2 -2
- package/dist/build/p-146bb45f.entry.js.map +1 -0
- package/dist/build/p-2000298f.entry.js +2 -0
- package/dist/build/p-2000298f.entry.js.map +1 -0
- package/dist/build/p-308e4330.js +2 -0
- package/dist/build/p-308e4330.js.map +1 -0
- package/dist/build/p-410c1df5.entry.js +2 -0
- package/dist/build/p-410c1df5.entry.js.map +1 -0
- package/dist/build/{p-2218e936.js → p-496a698b.js} +1 -1
- package/dist/build/p-64fc708f.entry.js +2 -0
- package/dist/build/p-64fc708f.entry.js.map +1 -0
- package/dist/build/p-7c6f6a23.entry.js +2 -0
- package/dist/build/p-7c6f6a23.entry.js.map +1 -0
- package/dist/build/p-7c8fa6b6.entry.js +2 -0
- package/dist/build/p-7c8fa6b6.entry.js.map +1 -0
- package/dist/build/p-8745a553.entry.js +2 -0
- package/dist/build/p-8745a553.entry.js.map +1 -0
- package/dist/build/p-8ca9c7c7.entry.js +2 -0
- package/dist/build/p-8ca9c7c7.entry.js.map +1 -0
- package/dist/build/p-9b01475d.entry.js +2 -0
- package/dist/build/p-9b01475d.entry.js.map +1 -0
- package/dist/build/p-cd9dbf02.entry.js +2 -0
- package/dist/build/p-cd9dbf02.entry.js.map +1 -0
- package/dist/build/p-db1cf43e.entry.js +2 -0
- package/dist/build/p-db1cf43e.entry.js.map +1 -0
- package/dist/build/p-dbf71a6f.entry.js +2 -0
- package/dist/build/p-dbf71a6f.entry.js.map +1 -0
- package/dist/build/p-edb96664.entry.js +2 -0
- package/dist/build/p-edb96664.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/build/paperless.esm.js.map +1 -1
- package/dist/cjs/as-boolean-777950b0.js +15 -0
- package/dist/cjs/as-boolean-777950b0.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js +7 -3
- package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/p-badge_3.cjs.entry.js +5 -4
- package/dist/cjs/p-badge_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +12 -11
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-checkbox_2.cjs.entry.js +8 -7
- package/dist/cjs/p-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +3 -2
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +5 -4
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown-menu-item_4.cjs.entry.js +13 -12
- package/dist/cjs/p-dropdown-menu-item_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-field_2.cjs.entry.js +13 -12
- package/dist/cjs/p-field_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-floating-menu-container_8.cjs.entry.js +7 -6
- package/dist/cjs/p-floating-menu-container_8.cjs.entry.js.map +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +4 -3
- package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/p-radio.cjs.entry.js +7 -6
- package/dist/cjs/p-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/p-select.cjs.entry.js +2 -1
- package/dist/cjs/p-select.cjs.entry.js.map +1 -1
- package/dist/cjs/p-toggle.cjs.entry.js +6 -5
- package/dist/cjs/p-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/atoms/backdrop/backdrop.component.js +7 -3
- package/dist/collection/components/atoms/backdrop/backdrop.component.js.map +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.js +8 -7
- package/dist/collection/components/atoms/checkbox/checkbox.component.js.map +1 -1
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +5 -4
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js.map +1 -1
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +12 -11
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map +1 -1
- package/dist/collection/components/atoms/floating-menu-item/floating-menu-item.component.js +9 -8
- package/dist/collection/components/atoms/floating-menu-item/floating-menu-item.component.js.map +1 -1
- package/dist/collection/components/atoms/radio/radio.component.js +7 -6
- package/dist/collection/components/atoms/radio/radio.component.js.map +1 -1
- package/dist/collection/components/atoms/segment-item/segment-item.component.js +5 -4
- package/dist/collection/components/atoms/segment-item/segment-item.component.js.map +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.js +6 -5
- package/dist/collection/components/atoms/toggle/toggle.component.js.map +1 -1
- package/dist/collection/components/molecules/button/button.component.js +12 -11
- package/dist/collection/components/molecules/button/button.component.js.map +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +3 -2
- package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
- package/dist/collection/components/molecules/field/field.component.js +11 -10
- package/dist/collection/components/molecules/field/field.component.js.map +1 -1
- package/dist/collection/components/molecules/field-container/field-container.component.js +3 -2
- package/dist/collection/components/molecules/field-container/field-container.component.js.map +1 -1
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +4 -3
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js.map +1 -1
- package/dist/collection/components/molecules/pagination-size/pagination-size.component.js +4 -3
- package/dist/collection/components/molecules/pagination-size/pagination-size.component.js.map +1 -1
- package/dist/collection/components/molecules/select/select.component.js +2 -1
- package/dist/collection/components/molecules/select/select.component.js.map +1 -1
- package/dist/collection/utils/as-boolean.js +10 -0
- package/dist/collection/utils/as-boolean.js.map +1 -0
- package/dist/components/as-boolean.js +13 -0
- package/dist/components/as-boolean.js.map +1 -0
- package/dist/components/backdrop.component.js +7 -3
- package/dist/components/backdrop.component.js.map +1 -1
- package/dist/components/button.component.js +12 -11
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/checkbox.component.js +8 -7
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/dropdown-menu-container.component.js +5 -4
- package/dist/components/dropdown-menu-container.component.js.map +1 -1
- package/dist/components/dropdown-menu-item.component.js +10 -9
- package/dist/components/dropdown-menu-item.component.js.map +1 -1
- package/dist/components/field-container.component.js +3 -2
- package/dist/components/field-container.component.js.map +1 -1
- package/dist/components/field.component.js +11 -10
- package/dist/components/field.component.js.map +1 -1
- package/dist/components/floating-menu-item.component.js +9 -8
- package/dist/components/floating-menu-item.component.js.map +1 -1
- package/dist/components/p-datepicker.js +3 -2
- package/dist/components/p-datepicker.js.map +1 -1
- package/dist/components/p-navigation-item.js +4 -3
- package/dist/components/p-navigation-item.js.map +1 -1
- package/dist/components/p-radio.js +7 -6
- package/dist/components/p-radio.js.map +1 -1
- package/dist/components/p-select.js +2 -1
- package/dist/components/p-select.js.map +1 -1
- package/dist/components/p-toggle.js +6 -5
- package/dist/components/p-toggle.js.map +1 -1
- package/dist/components/pagination-size.component.js +4 -3
- package/dist/components/pagination-size.component.js.map +1 -1
- package/dist/components/segment-item.component.js +5 -4
- package/dist/components/segment-item.component.js.map +1 -1
- package/dist/esm/as-boolean-141b269b.js +13 -0
- package/dist/esm/as-boolean-141b269b.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-backdrop.entry.js +7 -3
- package/dist/esm/p-backdrop.entry.js.map +1 -1
- package/dist/esm/p-badge_3.entry.js +5 -4
- package/dist/esm/p-badge_3.entry.js.map +1 -1
- package/dist/esm/p-button_3.entry.js +12 -11
- package/dist/esm/p-button_3.entry.js.map +1 -1
- package/dist/esm/p-checkbox_2.entry.js +8 -7
- package/dist/esm/p-checkbox_2.entry.js.map +1 -1
- package/dist/esm/p-datepicker.entry.js +3 -2
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-dropdown-menu-container.entry.js +5 -4
- package/dist/esm/p-dropdown-menu-container.entry.js.map +1 -1
- package/dist/esm/p-dropdown-menu-item_4.entry.js +13 -12
- package/dist/esm/p-dropdown-menu-item_4.entry.js.map +1 -1
- package/dist/esm/p-field_2.entry.js +13 -12
- package/dist/esm/p-field_2.entry.js.map +1 -1
- package/dist/esm/p-floating-menu-container_8.entry.js +7 -6
- package/dist/esm/p-floating-menu-container_8.entry.js.map +1 -1
- package/dist/esm/p-navigation-item.entry.js +4 -3
- package/dist/esm/p-navigation-item.entry.js.map +1 -1
- package/dist/esm/p-radio.entry.js +7 -6
- package/dist/esm/p-radio.entry.js.map +1 -1
- package/dist/esm/p-select.entry.js +2 -1
- package/dist/esm/p-select.entry.js.map +1 -1
- package/dist/esm/p-toggle.entry.js +6 -5
- package/dist/esm/p-toggle.entry.js.map +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/{p-d6bda000.entry.js → p-146bb45f.entry.js} +2 -2
- package/dist/paperless/p-146bb45f.entry.js.map +1 -0
- package/dist/paperless/p-2000298f.entry.js +2 -0
- package/dist/paperless/p-2000298f.entry.js.map +1 -0
- package/dist/paperless/p-308e4330.js +2 -0
- package/dist/paperless/p-308e4330.js.map +1 -0
- package/dist/paperless/p-410c1df5.entry.js +2 -0
- package/dist/paperless/p-410c1df5.entry.js.map +1 -0
- package/dist/paperless/p-64fc708f.entry.js +2 -0
- package/dist/paperless/p-64fc708f.entry.js.map +1 -0
- package/dist/paperless/p-7c6f6a23.entry.js +2 -0
- package/dist/paperless/p-7c6f6a23.entry.js.map +1 -0
- package/dist/paperless/p-7c8fa6b6.entry.js +2 -0
- package/dist/paperless/p-7c8fa6b6.entry.js.map +1 -0
- package/dist/paperless/p-8745a553.entry.js +2 -0
- package/dist/paperless/p-8745a553.entry.js.map +1 -0
- package/dist/paperless/p-8ca9c7c7.entry.js +2 -0
- package/dist/paperless/p-8ca9c7c7.entry.js.map +1 -0
- package/dist/paperless/p-9b01475d.entry.js +2 -0
- package/dist/paperless/p-9b01475d.entry.js.map +1 -0
- package/dist/paperless/p-cd9dbf02.entry.js +2 -0
- package/dist/paperless/p-cd9dbf02.entry.js.map +1 -0
- package/dist/paperless/p-db1cf43e.entry.js +2 -0
- package/dist/paperless/p-db1cf43e.entry.js.map +1 -0
- package/dist/paperless/p-dbf71a6f.entry.js +2 -0
- package/dist/paperless/p-dbf71a6f.entry.js.map +1 -0
- package/dist/paperless/p-edb96664.entry.js +2 -0
- package/dist/paperless/p-edb96664.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/paperless/paperless.esm.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/utils/as-boolean.d.ts +1 -0
- package/hydrate/index.js +93 -79
- package/hydrate/index.mjs +93 -79
- package/package.json +1 -1
- package/dist/build/p-04459f71.entry.js +0 -2
- package/dist/build/p-04459f71.entry.js.map +0 -1
- package/dist/build/p-05a76cb5.entry.js +0 -2
- package/dist/build/p-05a76cb5.entry.js.map +0 -1
- package/dist/build/p-1c725862.entry.js +0 -2
- package/dist/build/p-1c725862.entry.js.map +0 -1
- package/dist/build/p-2841c42f.entry.js +0 -2
- package/dist/build/p-2841c42f.entry.js.map +0 -1
- package/dist/build/p-590a1b81.entry.js +0 -2
- package/dist/build/p-590a1b81.entry.js.map +0 -1
- package/dist/build/p-711bb72e.entry.js +0 -2
- package/dist/build/p-711bb72e.entry.js.map +0 -1
- package/dist/build/p-885497ca.entry.js +0 -2
- package/dist/build/p-885497ca.entry.js.map +0 -1
- package/dist/build/p-a64d7a8d.entry.js +0 -2
- package/dist/build/p-a64d7a8d.entry.js.map +0 -1
- package/dist/build/p-ba0e7853.entry.js +0 -2
- package/dist/build/p-ba0e7853.entry.js.map +0 -1
- package/dist/build/p-d6bda000.entry.js.map +0 -1
- package/dist/build/p-eb654d58.entry.js +0 -2
- package/dist/build/p-eb654d58.entry.js.map +0 -1
- package/dist/build/p-ef2983f6.entry.js +0 -2
- package/dist/build/p-ef2983f6.entry.js.map +0 -1
- package/dist/build/p-ff6356cb.entry.js +0 -2
- package/dist/build/p-ff6356cb.entry.js.map +0 -1
- package/dist/paperless/p-04459f71.entry.js +0 -2
- package/dist/paperless/p-04459f71.entry.js.map +0 -1
- package/dist/paperless/p-05a76cb5.entry.js +0 -2
- package/dist/paperless/p-05a76cb5.entry.js.map +0 -1
- package/dist/paperless/p-1c725862.entry.js +0 -2
- package/dist/paperless/p-1c725862.entry.js.map +0 -1
- package/dist/paperless/p-2841c42f.entry.js +0 -2
- package/dist/paperless/p-2841c42f.entry.js.map +0 -1
- package/dist/paperless/p-590a1b81.entry.js +0 -2
- package/dist/paperless/p-590a1b81.entry.js.map +0 -1
- package/dist/paperless/p-711bb72e.entry.js +0 -2
- package/dist/paperless/p-711bb72e.entry.js.map +0 -1
- package/dist/paperless/p-885497ca.entry.js +0 -2
- package/dist/paperless/p-885497ca.entry.js.map +0 -1
- package/dist/paperless/p-a64d7a8d.entry.js +0 -2
- package/dist/paperless/p-a64d7a8d.entry.js.map +0 -1
- package/dist/paperless/p-ba0e7853.entry.js +0 -2
- package/dist/paperless/p-ba0e7853.entry.js.map +0 -1
- package/dist/paperless/p-d6bda000.entry.js.map +0 -1
- package/dist/paperless/p-eb654d58.entry.js +0 -2
- package/dist/paperless/p-eb654d58.entry.js.map +0 -1
- package/dist/paperless/p-ef2983f6.entry.js +0 -2
- package/dist/paperless/p-ef2983f6.entry.js.map +0 -1
- package/dist/paperless/p-ff6356cb.entry.js +0 -2
- package/dist/paperless/p-ff6356cb.entry.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { nonce } from "../../../utils/nonce";
|
|
4
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
4
5
|
const checkbox = cva([
|
|
5
6
|
'peer appearance-none m-0 outline-none flex-shrink-0',
|
|
6
7
|
'border border-inset border-solid ',
|
|
@@ -61,13 +62,13 @@ export class Checkbox {
|
|
|
61
62
|
*/
|
|
62
63
|
indeterminateChange;
|
|
63
64
|
render() {
|
|
64
|
-
return (h(Host, { key: '
|
|
65
|
-
disabled: this.disabled,
|
|
66
|
-
}), type: 'checkbox', id: this.id ?? this._nonce, name: this.name, required: this.required, checked: !!this.checked, indeterminate: this.indeterminate, disabled: this.disabled, onChange: ev => this._onChange(ev) }), h("div", { key: '
|
|
67
|
-
disabled: this.disabled,
|
|
68
|
-
}) }, h("p-icon", { key: '
|
|
69
|
-
disabled: this.disabled,
|
|
70
|
-
}), size: 'auto', variant: !!this.indeterminate ? 'minus' : 'checkmarkThick' }))), h("slot", { key: '
|
|
65
|
+
return (h(Host, { key: '67d7d568e204e24280ec939c20b9df9940d32866', class: 'p-checkbox' }, h("label", { key: '1726a9fd3784633f385ab222399e0d9749d9a757', htmlFor: this.id ?? this._nonce, class: 'group/p-checkbox flex items-center justify-start gap-2 text-black-teal' }, h("div", { key: '0dbf6abd950aa26e270ab2d7ca561636693d1cad', class: 'relative flex flex-shrink-0 items-center' }, h("input", { key: 'dcf66a3a330c0f9ce2b825397372ba4435e2313b', class: checkbox({
|
|
66
|
+
disabled: asBoolean(this.disabled),
|
|
67
|
+
}), type: 'checkbox', id: this.id ?? this._nonce, name: this.name, required: asBoolean(this.required), checked: !!this.checked, indeterminate: this.indeterminate, disabled: asBoolean(this.disabled), onChange: ev => this._onChange(ev) }), h("div", { key: '2297a0eb43fa60076b96ea4023297a929ed1fe95', class: iconContainer({
|
|
68
|
+
disabled: asBoolean(this.disabled),
|
|
69
|
+
}) }, h("p-icon", { key: '65670d446eacc9640628a07e409ced8fa1c19df4', class: icon({
|
|
70
|
+
disabled: asBoolean(this.disabled),
|
|
71
|
+
}), size: 'auto', variant: !!this.indeterminate ? 'minus' : 'checkmarkThick' }))), h("slot", { key: 'e0fdb4ea59fe99badb2a80ba582d5b5eca313abf' }))));
|
|
71
72
|
}
|
|
72
73
|
_onChange(ev) {
|
|
73
74
|
if (this.disabled) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/checkbox/checkbox.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/checkbox/checkbox.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,QAAQ,GAAG,GAAG,CACnB;IACC,qDAAqD;IACrD,mCAAmC;IACnC,iBAAiB;CACjB,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,gCAAgC;gBAChC,2DAA2D;gBAC3D,0DAA0D;gBAC1D,kDAAkD;gBAClD,0EAA0E;gBAC1E,0EAA0E;gBAC1E,8DAA8D;gBAC9D,kFAAkF;aAClF;YACD,IAAI,EAAE,uDAAuD;SAC7D;KACD;CACD,C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n\tEventEmitter,\n\tHost,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { nonce } from '../../../utils/nonce';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst checkbox = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'border border-inset border-solid ',\n\t\t'rounded w-4 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportive-lilac-100 hover:border-black-teal-100',\n\t\t\t\t\t'checked:bg-supportive-lilac checked:border-black-teal/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-supportive-lilac-100',\n\t\t\t\t\t'checked:hover:bg-supportive-lilac-700 checked:hover:border-black-teal/20',\n\t\t\t\t\t'indeterminate:bg-supportive-lilac-700 indeterminate:border-black-teal/20',\n\t\t\t\t\t'indeterminate:ring-2 indeterminate:ring-supportive-lilac-100',\n\t\t\t\t\t'indeterminate:hover:bg-supportive-lilac indeterminate:hover:border-black-teal/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-black-teal-50 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst iconContainer = cva(\n\t[\n\t\t'hidden peer-indeterminate:flex peer-checked:flex',\n\t\t'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: 'text-white',\n\t\t\t\ttrue: 'text-black-teal-200',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst icon = cva(['drop-shadow-black-teal-10% text-xs'], {\n\tvariants: {\n\t\tdisabled: {\n\t\t\tfalse: 'group-hover/p-checkbox:text-sm',\n\t\t\ttrue: null,\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-checkbox',\n\tstyleUrl: 'checkbox.component.css',\n})\nexport class Checkbox {\n\t/**\n\t * Wether the checkbox is checked\n\t */\n\t@Prop() checked: boolean;\n\n\t/**\n\t * Wether the checkbox is in indeterminate state\n\t */\n\t@Prop() indeterminate: boolean;\n\n\t/**\n\t * Wether the checkbox is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the checkbox is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the checkbox button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the checkbox button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\t/**\n\t * Event whenever the indeterminate changes\n\t */\n\t@Event() indeterminateChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-checkbox'>\n\t\t\t\t<label\n\t\t\t\t\thtmlFor={this.id ?? this._nonce}\n\t\t\t\t\tclass='group/p-checkbox flex items-center justify-start gap-2 text-black-teal'\n\t\t\t\t>\n\t\t\t\t\t<div class='relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={checkbox({\n\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\t\tid={this.id ?? this._nonce}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\trequired={asBoolean(this.required)}\n\t\t\t\t\t\t\tchecked={!!this.checked}\n\t\t\t\t\t\t\tindeterminate={this.indeterminate}\n\t\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={iconContainer({\n\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\tclass={icon({\n\t\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tsize='auto'\n\t\t\t\t\t\t\t\tvariant={!!this.indeterminate ? 'minus' : 'checkmarkThick'}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</label>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tconst indeterminate = (ev.target as HTMLInputElement).indeterminate;\n\n\t\tif (checked != this.checked) {\n\t\t\tthis.checked = checked;\n\t\t\tthis.checkedChange.emit(checked);\n\t\t}\n\n\t\tif (indeterminate != this.indeterminate) {\n\t\t\tthis.indeterminate = indeterminate;\n\t\t\tthis.indeterminateChange.emit(indeterminate);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
3
4
|
const dropdownMenuContainer = cva(['p-dropdown-menu-container', 'p-1', 'rounded-lg z-10', 'border'], {
|
|
4
5
|
variants: {
|
|
5
6
|
variant: {
|
|
@@ -41,14 +42,14 @@ export class DropdownMenuContainer {
|
|
|
41
42
|
: this.scrollable === true
|
|
42
43
|
? 'default'
|
|
43
44
|
: this.scrollable;
|
|
44
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '40d82bee7fcc639ec89b6824ef8cfbbdcd3ed42c', class: dropdownMenuContainer({
|
|
45
46
|
class: this.class,
|
|
46
47
|
variant: this.variant,
|
|
47
|
-
fullWidth: this.fullWidth,
|
|
48
|
-
allowOverflow: this.allowOverflow,
|
|
48
|
+
fullWidth: asBoolean(this.fullWidth, true),
|
|
49
|
+
allowOverflow: asBoolean(this.allowOverflow),
|
|
49
50
|
scrollable,
|
|
50
51
|
maxWidth: this.maxWidth,
|
|
51
|
-
}) }, h("div", { key: '
|
|
52
|
+
}) }, h("div", { key: '178eca33c0f2a3c0bd488fd2533f3cc9d74fe3ce', class: 'flex w-full flex-col gap-[1px]' }, h("slot", { key: 'facfdfe6229e88177bc2adac657e8bb2df923812' }))));
|
|
52
53
|
}
|
|
53
54
|
static get is() { return "p-dropdown-menu-container"; }
|
|
54
55
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-container.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/dropdown-menu-container/dropdown-menu-container.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu-container.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/dropdown-menu-container/dropdown-menu-container.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,qBAAqB,GAAG,GAAG,CAChC,CAAC,2BAA2B,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EACjE;IACC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,8CAA8C;Y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;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst dropdownMenuContainer = cva(\n\t['p-dropdown-menu-container', 'p-1', 'rounded-lg z-10', 'border'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: 'bg-white border-black-teal-100 drop-shadow-2',\n\t\t\t\t'dark-teal': 'bg-dark-teal-600 drop-shadow-3 border-dark-teal-600',\n\t\t\t},\n\t\t\tfullWidth: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'w-full',\n\t\t\t},\n\t\t\tallowOverflow: {\n\t\t\t\tfalse: 'overflow-y-auto overflow-x-hidden',\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tscrollable: {\n\t\t\t\tnone: null,\n\t\t\t\tdefault: 'max-h-[11.5rem]',\n\t\t\t\tlarge: 'max-h-[13.875rem]',\n\t\t\t\txlarge: 'max-h-[20rem]',\n\t\t\t},\n\t\t\tmaxWidth: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'w-auto max-w-[13.875rem]',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-dropdown-menu-container',\n\tstyleUrl: 'dropdown-menu-container.component.css',\n})\nexport class DropdownMenuContainer {\n\t/**\n\t * The variant of the container\n\t */\n\t@Prop() variant: 'default' | 'dark-teal' = 'default';\n\n\t/**\n\t * Wether the container applies it's max width\n\t */\n\t@Prop() maxWidth: boolean = true;\n\n\t/**\n\t * The class of the container passed by parent\n\t */\n\t@Prop() class: string;\n\n\t/**\n\t * Wether the container should all available space\n\t */\n\t@Prop() fullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' | 'xlarge' = false;\n\n\trender() {\n\t\tconst scrollable =\n\t\t\tthis.scrollable === false\n\t\t\t\t? 'none'\n\t\t\t\t: this.scrollable === true\n\t\t\t\t? 'default'\n\t\t\t\t: this.scrollable;\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={dropdownMenuContainer({\n\t\t\t\t\tclass: this.class,\n\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\tfullWidth: asBoolean(this.fullWidth, true),\n\t\t\t\t\tallowOverflow: asBoolean(this.allowOverflow),\n\t\t\t\t\tscrollable,\n\t\t\t\t\tmaxWidth: this.maxWidth,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div class='flex w-full flex-col gap-[1px]'>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
3
4
|
const dropdownMenuItem = cva([
|
|
4
5
|
'p-dropdown-menu-item flex px-2 py-1 gap-2 text-sm font-medium group rounded-lg items-center h-8 max-w-full',
|
|
5
6
|
], {
|
|
@@ -149,22 +150,22 @@ export class DropdownMenuItem {
|
|
|
149
150
|
this.active = false;
|
|
150
151
|
this.checkbox = false;
|
|
151
152
|
this.variant = 'default';
|
|
152
|
-
this.enableHover =
|
|
153
|
+
this.enableHover = false;
|
|
153
154
|
this.disabled = false;
|
|
154
155
|
this.icon = undefined;
|
|
155
156
|
this.useContainer = true;
|
|
156
157
|
}
|
|
157
158
|
render() {
|
|
158
|
-
return (h(Host, { key: '
|
|
159
|
+
return (h(Host, { key: '2d41e180b8c3134d323188998af074678036754c', class: dropdownMenuItem({
|
|
159
160
|
variant: this.variant,
|
|
160
|
-
active: this.active,
|
|
161
|
-
enableHover: this.enableHover,
|
|
162
|
-
disabled: this.disabled,
|
|
163
|
-
}) }, this.icon && (h("p-icon", { key: '
|
|
161
|
+
active: asBoolean(this.active),
|
|
162
|
+
enableHover: asBoolean(this.enableHover ?? true),
|
|
163
|
+
disabled: asBoolean(this.disabled),
|
|
164
|
+
}) }, this.icon && (h("p-icon", { key: '12a5e2703c8d60e82d20031bd49a4a1bbe229c56', class: dropdownMenuItemIcon({
|
|
164
165
|
variant: this.variant,
|
|
165
|
-
active: this.active,
|
|
166
|
-
disabled: this.disabled,
|
|
167
|
-
}), variant: this.icon })), this.checkbox && (h("p-checkbox", { key: '
|
|
166
|
+
active: asBoolean(this.active),
|
|
167
|
+
disabled: asBoolean(this.disabled),
|
|
168
|
+
}), variant: this.icon })), this.checkbox && (h("p-checkbox", { key: 'f30b4ca26e3aa12bb16dba87e8d49d527263e5fd', checked: this.active, disabled: this.disabled })), this.useContainer ? (h("div", { class: 'block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start' }, h("slot", null))) : (h("slot", null))));
|
|
168
169
|
}
|
|
169
170
|
static get is() { return "p-dropdown-menu-item"; }
|
|
170
171
|
static get originalStyleUrls() {
|
|
@@ -248,7 +249,7 @@ export class DropdownMenuItem {
|
|
|
248
249
|
"references": {}
|
|
249
250
|
},
|
|
250
251
|
"required": false,
|
|
251
|
-
"optional":
|
|
252
|
+
"optional": true,
|
|
252
253
|
"docs": {
|
|
253
254
|
"tags": [],
|
|
254
255
|
"text": "Wether to enable the hover state"
|
|
@@ -257,7 +258,7 @@ export class DropdownMenuItem {
|
|
|
257
258
|
"setter": false,
|
|
258
259
|
"attribute": "enable-hover",
|
|
259
260
|
"reflect": false,
|
|
260
|
-
"defaultValue": "
|
|
261
|
+
"defaultValue": "false"
|
|
261
262
|
},
|
|
262
263
|
"disabled": {
|
|
263
264
|
"type": "boolean",
|
package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/dropdown-menu-item/dropdown-menu-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,gBAAgB,GAAG,GAAG,CAC3B;IACC,4GAA4G;CAC5G,EACD;IACC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACP,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,oBAAoB;SAC1B;QACD,WAAW,EAAE;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,8CAA8C;SACrD;QACD;YACC,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,yBAAyB;SAChC;QACD;YACC,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,qBAAqB;SAC5B;QACD;YACC,OAAO,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AC;iBAClC,CAAC,EACF,OAAO,EAAE,IAAI,CAAC,IAAI,GACjB,CACF;YAEA,IAAI,CAAC,QAAQ,IAAI,CACjB,mEACC,OAAO,EAAE,IAAI,CAAC,MAAM,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACtB,CACF;YAEA,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,WAAK,KAAK,EAAC,yEAAyE;gBACnF,eAAQ,CACH,CACN,CAAC,CAAC,CAAC,CACH,eAAQ,CACR,CACK,CACP,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { IconVariant } from '../icon/icon.component';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst dropdownMenuItem = cva(\n\t[\n\t\t'p-dropdown-menu-item flex px-2 py-1 gap-2 text-sm font-medium group rounded-lg items-center h-8 max-w-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: null,\n\t\t\t\t'dark-teal': null,\n\t\t\t\tnegative: null,\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: 'cursor-pointer',\n\t\t\t\ttrue: 'cursor-not-allowed',\n\t\t\t},\n\t\t\tenableHover: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tactive: false,\n\t\t\t\tenableHover: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-black-teal hover:bg-supportive-lilac-50',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tactive: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'bg-supportive-lilac-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'text-black-teal-200',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tdisabled: true,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'bg-supportive-lilac-100',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: 'dark-teal',\n\t\t\t\tactive: false,\n\t\t\t\tenableHover: true,\n\t\t\t\tclass: 'text-white',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'dark-teal',\n\t\t\t\tactive: false,\n\t\t\t\tenableHover: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'hover:bg-dark-teal-400',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'dark-teal',\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'text-white bg-dark-teal-400',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'dark-teal',\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'opacity-40',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tvariant: 'negative',\n\t\t\t\tactive: false,\n\t\t\t\tenableHover: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'text-negative-red hover:bg-negative-red-50',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'negative',\n\t\t\t\tactive: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'bg-negative-red-100 text-negative-red',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'negative',\n\t\t\t\tdisabled: true,\n\t\t\t\tclass: 'text-negative-red-100',\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'negative',\n\t\t\t\tdisabled: true,\n\t\t\t\tactive: true,\n\t\t\t\tclass: 'bg-negative-red-50',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tenableHover: true,\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: 'cursor-pointer',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst dropdownMenuItemIcon = cva(['text-base'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: null,\n\t\t\t'dark-teal': null,\n\t\t\tnegative: null,\n\t\t},\n\t\tactive: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tdisabled: {\n\t\t\tfalse: null,\n\t\t\ttrue: 'text-black-teal-100',\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariant: 'default',\n\t\t\tactive: false,\n\t\t\tdisabled: false,\n\t\t\tclass: 'text-black-teal-300 group-hover:text-black-teal',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'dark-teal',\n\t\t\tactive: false,\n\t\t\tdisabled: false,\n\t\t\tclass: 'text-dark-teal-100 group-hover:text-white',\n\t\t},\n\n\t\t{\n\t\t\tvariant: 'negative',\n\t\t\tactive: false,\n\t\t\tdisabled: false,\n\t\t\tclass: 'text-negative-red group-hover:text-negative-red-800',\n\t\t},\n\t\t{\n\t\t\tvariant: 'negative',\n\t\t\tactive: true,\n\t\t\tdisabled: false,\n\t\t\tclass: 'text-negative-red-800',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-dropdown-menu-item',\n\tstyleUrl: 'dropdown-menu-item.component.css',\n})\nexport class DropdownMenuItem {\n\t/**\n\t * Wether the dropdown menu item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * Wether the dropdown menu item has a checkbox\n\t */\n\t@Prop() checkbox: boolean = false;\n\n\t/**\n\t * The variant of the item\n\t */\n\t@Prop() variant: 'default' | 'dark-teal' | 'negative' = 'default';\n\n\t/**\n\t * Wether to enable the hover state\n\t */\n\t@Prop() enableHover?: boolean = false;\n\n\t/**\n\t * Wether the item is disabled\n\t */\n\t@Prop() disabled: boolean = false;\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * wether to use the container for text\n\t */\n\t@Prop() useContainer = true;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={dropdownMenuItem({\n\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\tenableHover: asBoolean(this.enableHover ?? true),\n\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.icon && (\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\tclass={dropdownMenuItemIcon({\n\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t\tvariant={this.icon}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.checkbox && (\n\t\t\t\t\t<p-checkbox\n\t\t\t\t\t\tchecked={this.active}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.useContainer ? (\n\t\t\t\t\t<div class='block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<slot />\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
3
4
|
const item = cva([
|
|
4
5
|
'p-floating-menu-item group',
|
|
5
6
|
'flex gap-2 items-center h-6',
|
|
@@ -53,10 +54,10 @@ export class FloatingMenuItem {
|
|
|
53
54
|
this.iconRotate = undefined;
|
|
54
55
|
}
|
|
55
56
|
render() {
|
|
56
|
-
return (h(Host, { key: '
|
|
57
|
-
hover: this.hover && !this.loading,
|
|
58
|
-
disabled: this.disabled,
|
|
59
|
-
}) }, this._getIcon(), h("p", { key: '
|
|
57
|
+
return (h(Host, { key: '3cb99305ad3b1538dd172adda934020013535e6f', class: item({
|
|
58
|
+
hover: asBoolean(this.hover) && !asBoolean(this.loading),
|
|
59
|
+
disabled: asBoolean(this.disabled),
|
|
60
|
+
}) }, this._getIcon(), h("p", { key: 'b1800c870b90854a44f8edea23b4e5021a9b1473', class: 'min-w-0 overflow-hidden text-ellipsis text-nowrap font-semibold' }, h("slot", { key: '8ebc6d4d9acc37952370737eb5a1abaeff7c81bb' }))));
|
|
60
61
|
}
|
|
61
62
|
_getIcon() {
|
|
62
63
|
if (!this.icon && !this.loading) {
|
|
@@ -66,8 +67,8 @@ export class FloatingMenuItem {
|
|
|
66
67
|
return h("p-loader", { color: 'white' });
|
|
67
68
|
}
|
|
68
69
|
return (h("p-icon", { class: icon({
|
|
69
|
-
hover: this.hover,
|
|
70
|
-
disabled: this.disabled,
|
|
70
|
+
hover: asBoolean(this.hover),
|
|
71
|
+
disabled: asBoolean(this.disabled),
|
|
71
72
|
}), variant: this.icon, flip: this.iconFlip, rotate: this.iconRotate }));
|
|
72
73
|
}
|
|
73
74
|
static get is() { return "p-floating-menu-item"; }
|
|
@@ -100,7 +101,7 @@ export class FloatingMenuItem {
|
|
|
100
101
|
"getter": false,
|
|
101
102
|
"setter": false,
|
|
102
103
|
"attribute": "hover",
|
|
103
|
-
"reflect":
|
|
104
|
+
"reflect": false,
|
|
104
105
|
"defaultValue": "true"
|
|
105
106
|
},
|
|
106
107
|
"disabled": {
|
|
@@ -120,7 +121,7 @@ export class FloatingMenuItem {
|
|
|
120
121
|
"getter": false,
|
|
121
122
|
"setter": false,
|
|
122
123
|
"attribute": "disabled",
|
|
123
|
-
"reflect":
|
|
124
|
+
"reflect": false,
|
|
124
125
|
"defaultValue": "false"
|
|
125
126
|
},
|
|
126
127
|
"loading": {
|
package/dist/collection/components/atoms/floating-menu-item/floating-menu-item.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-menu-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/floating-menu-item/floating-menu-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"floating-menu-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/floating-menu-item/floating-menu-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,IAAI,GAAG,GAAG,CACf;IACC,4BAA4B;IAC5B,6BAA6B;IAC7B,4BAA4B;CAC5B,EACD;IACC,QAAQ,EAAE;QACT,KAAK,EAAE;YACN,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,+BAA+B;SACrC;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,yCAAyC;SAChD;KACD;CACD,CACD,CAAC;AAEF,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,oBAAoB,CAAC,EAAE;IACxC,QAAQ,EAAE;QACT,KAAK,EAAE;YACN,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\nimport { RotateOptions } from '../../../types';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst item = cva(\n\t[\n\t\t'p-floating-menu-item group',\n\t\t'flex gap-2 items-center h-6',\n\t\t'text-sm text-dark-teal-300',\n\t],\n\t{\n\t\tvariants: {\n\t\t\thover: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tdisabled: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'opacity-60 cursor-not-allowed',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\thover: true,\n\t\t\t\tclass: 'cursor-pointer hover:text-dark-teal-100',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst icon = cva(['text-dark-teal-200'], {\n\tvariants: {\n\t\thover: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t\tdisabled: {\n\t\t\tfalse: null,\n\t\t\ttrue: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tdisabled: false,\n\t\t\thover: true,\n\t\t\tclass: 'group-hover:text-dark-teal-100',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-floating-menu-item',\n\tstyleUrl: 'floating-menu-item.component.css',\n})\nexport class FloatingMenuItem {\n\t/**\n\t * Wether it should have a hover effect\n\t */\n\t@Prop() hover: boolean = true;\n\n\t/**\n\t * Wether the item is disabled\n\t */\n\t@Prop() disabled: boolean = false;\n\n\t/**\n\t * Wether loading is applied\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Icon to show on the item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={item({\n\t\t\t\t\thover: asBoolean(this.hover) && !asBoolean(this.loading),\n\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this._getIcon()}\n\n\t\t\t\t<p class='min-w-0 overflow-hidden text-ellipsis text-nowrap font-semibold'>\n\t\t\t\t\t<slot />\n\t\t\t\t</p>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _getIcon() {\n\t\tif (!this.icon && !this.loading) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.loading) {\n\t\t\treturn <p-loader color='white' />;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tclass={icon({\n\t\t\t\t\thover: asBoolean(this.hover),\n\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t})}\n\t\t\t\tvariant={this.icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { nonce } from "../../../utils/nonce";
|
|
4
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
4
5
|
const radio = cva([
|
|
5
6
|
'peer appearance-none m-0 outline-none flex-shrink-0',
|
|
6
7
|
'rounded-full border border-inset border-solid ',
|
|
@@ -59,14 +60,14 @@ export class Radio {
|
|
|
59
60
|
*/
|
|
60
61
|
checkedChange;
|
|
61
62
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
63
|
-
disabled: this.disabled,
|
|
64
|
-
}), type: 'radio', id: this.id ?? this._nonce, name: this.name, required: this.required, value: this.value, checked: this.checked, disabled: this.disabled, onChange: ev => this._onChange(ev) }), h("div", { key: '
|
|
65
|
-
disabled: this.disabled,
|
|
66
|
-
}) })), h("slot", { key: '
|
|
63
|
+
return (h(Host, { key: '7ed775d83fd504b12c8bae5c2f845b35696318a0', class: 'p-radio' }, h("label", { key: '43433e2e61096f118a839e5cb7e593f2c1d45882', htmlFor: this.id ?? this._nonce, class: 'flex items-center justify-start gap-2 text-black-teal' }, h("div", { key: 'e47eb50a4a6c34f402b721e38975905957c4391a', class: 'relative flex flex-shrink-0 items-center' }, h("input", { key: '04168aa446a50b5806728eeb72425b3847bd3240', class: radio({
|
|
64
|
+
disabled: asBoolean(this.disabled),
|
|
65
|
+
}), type: 'radio', id: this.id ?? this._nonce, name: this.name, required: this.required, value: this.value, checked: this.checked, disabled: asBoolean(this.disabled), onChange: ev => this._onChange(ev) }), h("div", { key: 'adba2a0b0bd2593c36468834da9232aadd7bca65', class: circle({
|
|
66
|
+
disabled: asBoolean(this.disabled),
|
|
67
|
+
}) })), h("slot", { key: 'fb4649847a4ab9e30cb0d71f3bf63fcb308693e6' }))));
|
|
67
68
|
}
|
|
68
69
|
_onChange(ev) {
|
|
69
|
-
if (this.disabled) {
|
|
70
|
+
if (asBoolean(this.disabled)) {
|
|
70
71
|
ev.preventDefault();
|
|
71
72
|
return;
|
|
72
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"radio.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,KAAK,GAAG,GAAG,CAChB;IACC,qDAAqD;IACrD,gDAAgD;IAChD,SAAS;CACT,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,gCAAgC;gBAChC,4DAA4D;gBAC5D,qBAAqB;gBACrB,0DAA0D;gBAC1D,kDAAkD;gBAClD,sEAAsE;aACtE;YACD,IAAI,EAAE,uDAAuD;SAC7D;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE;gBACN,yBAAyB;gBACzB,gCAAgC;gBAChC,2DAA2D;aAC3D;SACD;KACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,OAAO;IACP,6BAA6B;IAC7B,2FAA2F;IAC3F,SAAS;CACT,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EACJ,2EAA2E;YAC5E,IAAI,EAAE,gCAAgC;SACtC;KACD;CACD,CACD,CAAC;AAMF,MAAM,OAAO,KAAK;;;wBAS4B,KAAK;wBAKL,IAAI;;;uBAeL,KAAK;sBAOvB,KAAK,CAAC,CAAC,CAAC;;IALlC;;OAEG;IACM,aAAa,CAAwB;IAI9C,MAAM;QACL,OAAO,CACN,EAAC,IAAI,qDAAC,KAAK,EAAC,SAAS;YACpB,8DACC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAA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n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tHost,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { nonce } from '../../../utils/nonce';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst radio = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'rounded-full border border-inset border-solid ',\n\t\t'w-4 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportivce-lilac-100 hover:border-black-teal-100',\n\t\t\t\t\t'checked:cursor-auto',\n\t\t\t\t\t'checked:bg-supportive-lilac checked:border-black-teal/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-supportive-lilac-100',\n\t\t\t\t\t'checked:hover:bg-supportive-lilac checked:hover:border-black-teal/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-black-teal-50 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tdisabled: false,\n\t\t\t\tclass: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-white border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportive-lilac-100 hover:border-black-teal-100',\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'block',\n\t\t'rounded-full bg-transparent',\n\t\t'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none',\n\t\t'w-2 h-2',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse:\n\t\t\t\t\t'peer-checked:bg-white peer-checked:ring-1 peer-checked:ring-black-teal/10',\n\t\t\t\ttrue: 'peer-checked:bg-black-teal-200',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-radio',\n\tstyleUrl: 'radio.component.css',\n})\nexport class Radio {\n\t/**\n\t * The value of the radio button\n\t */\n\t@Prop() value: string;\n\n\t/**\n\t * Wether the radio is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the radio is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the radio button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the radio button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Wether the radio is checked\n\t */\n\t@Prop({ reflect: true }) checked: boolean = false;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-radio'>\n\t\t\t\t<label\n\t\t\t\t\thtmlFor={this.id ?? this._nonce}\n\t\t\t\t\tclass='flex items-center justify-start gap-2 text-black-teal'\n\t\t\t\t>\n\t\t\t\t\t<div class='relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={radio({\n\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttype='radio'\n\t\t\t\t\t\t\tid={this.id ?? this._nonce}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</label>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (asBoolean(this.disabled)) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tthis.checked = checked;\n\t\tthis.checkedChange.emit(checked);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
3
4
|
const segmentItem = cva([
|
|
4
5
|
'p-segment-item',
|
|
5
6
|
'flex items-center justify-center',
|
|
@@ -32,11 +33,11 @@ export class SegmentItem {
|
|
|
32
33
|
}
|
|
33
34
|
render() {
|
|
34
35
|
const descriptionSlot = this.variant === 'block' ? h("slot", { name: 'description' }) : null;
|
|
35
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: 'a52fe32057a67da036508e7a557fc63b675ef0a1', class: segmentItem({
|
|
36
37
|
variant: this.variant,
|
|
37
|
-
active: this.active,
|
|
38
|
-
iconOnly: this.iconOnly,
|
|
39
|
-
}) }, this.icon && (h("p-icon", { key: '
|
|
38
|
+
active: asBoolean(this.active),
|
|
39
|
+
iconOnly: asBoolean(this.iconOnly),
|
|
40
|
+
}) }, this.icon && (h("p-icon", { key: '4f54334e3e9ac47cfbfc28048957428015322c25', variant: this.icon, flip: this.iconFlip, rotate: this.iconRotate })), this.variant === 'default' ? (h("slot", null)) : (h("div", { class: 'flex flex-col items-center gap-1' }, h("p", { class: 'font-semibold empty:hidden' }, h("slot", { name: 'title' })), descriptionSlot && h("p", { class: 'text-xs' }, descriptionSlot)))));
|
|
40
41
|
}
|
|
41
42
|
static get is() { return "p-segment-item"; }
|
|
42
43
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/segment-item/segment-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"segment-item.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/segment-item/segment-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,WAAW,GAAG,GAAG,CACtB;IACC,gBAAgB;IAChB,kCAAkC;IAClC,aAAa;IACb,wBAAwB;CACxB,EACD;IACC,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,0BAA0B;SACjC;QACD,MAAM,EAAE;YACP,KAAK,EAAE,2DAA2D;YAClE,IAAI,EAAE,6BAA6B;SACnC;QACD,QAAQ,EAAE;YACT,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,KAAK;SACX;KACD;CACD,CACD,CAAC;AAMF,MAAM,OAAO,WAAW;;uBAIgB,SAAS;sBAKtB,KAAK;wBAKH,KAAK;;;;;IAiBjC,MAAM;QACL,MAAM,eAAe,GACpB,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,YAAM,IAAI,EAAC,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAE/D,OAAO,CACN,EAAC,IAAI,qDACJ,KAAK,EAAE,WAAW,CAAC;gBAClB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;aAClC,CAAC;YAED,IAAI,CAAC,IAAI,IAAI,CACb,+DACC,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACtB,CACF;YAEA,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,eAAQ,CACR,CAAC,CAAC,CAAC,CACH,WAAK,KAAK,EAAC,kCAAkC;gBAC5C,SAAG,KAAK,EAAC,4BAA4B;oBACpC,YAAM,IAAI,EAAC,OAAO,GAAG,CAClB;gBACH,eAAe,IAAI,SAAG,KAAK,EAAC,SAAS,IAAE,eAAe,CAAK,CACvD,CACN,CACK,CACP,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst segmentItem = cva(\n\t[\n\t\t'p-segment-item',\n\t\t'flex items-center justify-center',\n\t\t'rounded-2xl',\n\t\t'cursor-pointer text-sm',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: 'h-6 gap-2',\n\t\t\t\tblock: 'flex-col p-4 text-center',\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\tfalse: 'cursor-pointer text-black-teal-400 hover:bg-black-teal-50',\n\t\t\t\ttrue: 'bg-dark-teal-600 text-white',\n\t\t\t},\n\t\t\ticonOnly: {\n\t\t\t\tfalse: 'px-2',\n\t\t\t\ttrue: 'w-6',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-segment-item',\n\tstyleUrl: 'segment-item.component.css',\n})\nexport class SegmentItem {\n\t/**\n\t * The size of the\n\t */\n\t@Prop() variant: 'default' | 'block' = 'default';\n\n\t/**\n\t * Wether the segment item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * Wether the segment item is icon only\n\t */\n\t@Prop() iconOnly: boolean = false;\n\n\t/**\n\t * Icon to show on the segment item\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\trender() {\n\t\tconst descriptionSlot =\n\t\t\tthis.variant === 'block' ? <slot name='description' /> : null;\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={segmentItem({\n\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\ticonOnly: asBoolean(this.iconOnly),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.icon && (\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\tvariant={this.icon}\n\t\t\t\t\t\tflip={this.iconFlip}\n\t\t\t\t\t\trotate={this.iconRotate}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{this.variant === 'default' ? (\n\t\t\t\t\t<slot />\n\t\t\t\t) : (\n\t\t\t\t\t<div class='flex flex-col items-center gap-1'>\n\t\t\t\t\t\t<p class='font-semibold empty:hidden'>\n\t\t\t\t\t\t\t<slot name='title' />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t{descriptionSlot && <p class='text-xs'>{descriptionSlot}</p>}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { nonce } from "../../../utils/nonce";
|
|
4
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
4
5
|
const checkbox = cva([
|
|
5
6
|
'peer appearance-none m-0 outline-none flex-shrink-0',
|
|
6
7
|
'border border-inset border-solid ',
|
|
@@ -61,14 +62,14 @@ export class Toggle {
|
|
|
61
62
|
*/
|
|
62
63
|
indeterminateChange;
|
|
63
64
|
render() {
|
|
64
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: '346633e23e7fee1765a57fca983375ab4565d76b', class: 'p-checkbox' }, h("label", { key: 'caa4d70fead2c33484d805cd5e32c8bd9385b1b0', htmlFor: this.id ?? this._nonce, class: 'flex items-center justify-start gap-2 text-black-teal' }, h("div", { key: 'c469c4e1b19daedf8386f4a00c111be4f2fa630a', class: 'group relative flex flex-shrink-0 items-center' }, h("input", { key: 'f325a11e63cf4b4134db50283348cc7514d0dec2', class: checkbox({
|
|
66
|
+
disabled: asBoolean(this.disabled),
|
|
67
|
+
}), type: 'checkbox', id: this.id ?? this._nonce, name: this.name, required: this.required, checked: !!this.checked, indeterminate: this.indeterminate, disabled: asBoolean(this.disabled), onChange: ev => this._onChange(ev) }), h("div", { key: 'df4144c18ad0b454b47b430637afc0ebf0cd2b7a', class: circle({
|
|
65
68
|
disabled: this.disabled,
|
|
66
|
-
})
|
|
67
|
-
disabled: this.disabled,
|
|
68
|
-
}) })), h("slot", { key: '271b918b319a8ae027ed106f3ba32d833e2215df' }))));
|
|
69
|
+
}) })), h("slot", { key: '8f431ddb98a4bd29836e6fb570825b1f610522e3' }))));
|
|
69
70
|
}
|
|
70
71
|
_onChange(ev) {
|
|
71
|
-
if (this.disabled) {
|
|
72
|
+
if (asBoolean(this.disabled)) {
|
|
72
73
|
ev.preventDefault();
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/toggle/toggle.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/toggle/toggle.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,QAAQ,GAAG,GAAG,CACnB;IACC,qDAAqD;IACrD,mCAAmC;IACnC,sBAAsB;CACtB,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,wCAAwC;gBACxC,2DAA2D;gBAC3D,0DAA0D;gBAC1D,kDAAkD;gBAClD,0EAA0E;aAC1E;YACD,IAAI,EAAE,uDAAuD;SAC7D;KACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,kCAAkC;IAClC,8BAA8B;IAC9B,0FAA0F;CAC1F,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,oCAAoC;gBACpC,uDAAuD;gBACvD,yHAAyH;gBACzH,wCAAwC;gBACxC,2CAA2C;aAC3C;YACD,IAAI,EAAE;gBACL,kDAAkD;gBAClD,uDAAuD;gBACvD,SAAS;aACT;SACD;KACD;CACD,CACD,CAAC;AAMF,MAAM,OAAO,MA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AAC;QAEpE,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,aAAa,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YACnC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tHost,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { nonce } from '../../../utils/nonce';\nimport { asBoolean } from '../../../utils/as-boolean';\n\nconst checkbox = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'border border-inset border-solid ',\n\t\t'rounded-full w-8 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-black-teal-50 border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportive-lilac-100 hover:border-black-teal-100',\n\t\t\t\t\t'checked:bg-supportive-lilac checked:border-black-teal/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-supportive-lilac-100',\n\t\t\t\t\t'checked:hover:bg-supportive-lilac-700 checked:hover:border-black-teal/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-black-teal-50 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'flex items-center justify-center',\n\t\t'rounded-full transition-all ',\n\t\t'absolute top-1/2 peer-checked:left-full transform -translate-y-1/2 pointer-events-none',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'bg-white ring-1 ring-black-teal/10',\n\t\t\t\t\t'left-[1px] peer-checked:-translate-x-[calc(100%+1px)]',\n\t\t\t\t\t\"after:content-[] peer-checked:after:content-[''] after:bg-supportive-lilac-800 after:rounded-full after:transition-all\",\n\t\t\t\t\t'w-[14px] h-[14px] group-hover:w-[18px]',\n\t\t\t\t\t'after:w-1 after:h-1 group-hover:after:w-2',\n\t\t\t\t],\n\t\t\t\ttrue: [\n\t\t\t\t\t'bg-black-teal-100 peer-checked:bg-black-teal-200',\n\t\t\t\t\t'left-[2px] peer-checked:-translate-x-[calc(100%+2px)]',\n\t\t\t\t\t'w-3 h-3',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-toggle',\n\tstyleUrl: 'toggle.component.css',\n})\nexport class Toggle {\n\t/**\n\t * Wether the checkbox is checked\n\t */\n\t@Prop() checked: boolean;\n\n\t/**\n\t * Wether the checkbox is in indeterminate state\n\t */\n\t@Prop() indeterminate: boolean;\n\n\t/**\n\t * Wether the checkbox is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the checkbox is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the checkbox button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the checkbox button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\t/**\n\t * Event whenever the indeterminate changes\n\t */\n\t@Event() indeterminateChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-checkbox'>\n\t\t\t\t<label\n\t\t\t\t\thtmlFor={this.id ?? this._nonce}\n\t\t\t\t\tclass='flex items-center justify-start gap-2 text-black-teal'\n\t\t\t\t>\n\t\t\t\t\t<div class='group relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={checkbox({\n\t\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\t\tid={this.id ?? this._nonce}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tchecked={!!this.checked}\n\t\t\t\t\t\t\tindeterminate={this.indeterminate}\n\t\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\t\tdisabled: this.disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</label>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (asBoolean(this.disabled)) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tconst indeterminate = (ev.target as HTMLInputElement).indeterminate;\n\n\t\tif (checked != this.checked) {\n\t\t\tthis.checked = checked;\n\t\t\tthis.checkedChange.emit(checked);\n\t\t}\n\n\t\tif (indeterminate != this.indeterminate) {\n\t\t\tthis.indeterminate = indeterminate;\n\t\t\tthis.indeterminateChange.emit(indeterminate);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { asBoolean } from "../../../utils/as-boolean";
|
|
3
4
|
const button = cva([
|
|
4
5
|
'group',
|
|
5
6
|
'font-semibold leading-4',
|
|
@@ -288,24 +289,24 @@ export class Button {
|
|
|
288
289
|
const VariableTag = this.variant === 'text' || this.href?.length || this.as === 'a'
|
|
289
290
|
? 'a'
|
|
290
291
|
: 'button';
|
|
291
|
-
const active = this.active || this.class?.includes('active');
|
|
292
|
-
return (h(Host, { key: '
|
|
292
|
+
const active = asBoolean(this.active) || this.class?.includes('active');
|
|
293
|
+
return (h(Host, { key: 'c07e9f061c1ced17cedb0b7bbbbac5d00177cb70', class: 'p-button inline-block' }, h(VariableTag, { key: 'bb09f943cfa2428f8d4f94c40713f3c9cb47bbd5', disabled: this.disabled, href: this.href, type: this.variant !== 'text' ? this.type : undefined, target: this.target, class: button({
|
|
293
294
|
variant: this.variant,
|
|
294
295
|
size: this.size,
|
|
295
|
-
underline: this.underline,
|
|
296
|
-
loading: this.loading,
|
|
297
|
-
disabled: this.disabled,
|
|
296
|
+
underline: asBoolean(this.underline, true),
|
|
297
|
+
loading: asBoolean(this.loading),
|
|
298
|
+
disabled: asBoolean(this.disabled),
|
|
298
299
|
buttonGroupPosition: this.buttonGroupPosition,
|
|
299
|
-
iconOnly: this.iconOnly,
|
|
300
|
+
iconOnly: asBoolean(this.iconOnly),
|
|
300
301
|
active,
|
|
301
|
-
}) }, this.chevron && this.chevronPosition === 'start' && (h("p-icon", { key: '
|
|
302
|
+
}) }, this.chevron && this.chevronPosition === 'start' && (h("p-icon", { key: '8b8161a8e018ede3555974b56ac725758fe74fac', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.icon &&
|
|
302
303
|
this.iconPosition === 'start' &&
|
|
303
304
|
!(this.iconOnly && this.loading) &&
|
|
304
|
-
this._getIcon(), h("slot", { key: '
|
|
305
|
+
this._getIcon(), h("slot", { key: '168574cbad66d2d7d4f81819d45925a4ee73d4e6' }), this.icon &&
|
|
305
306
|
this.iconPosition === 'end' &&
|
|
306
307
|
!this.loading &&
|
|
307
308
|
!this.chevron &&
|
|
308
|
-
this._getIcon(), this.chevron && !this.loading && this.chevronPosition === 'end' && (h("p-icon", { key: '
|
|
309
|
+
this._getIcon(), this.chevron && !this.loading && this.chevronPosition === 'end' && (h("p-icon", { key: '6a78154cefef83683a144dff242d01a092bb1c35', variant: 'caret', rotate: this.chevron === 'up' ? 180 : 0 })), this.loading && h("p-loader", { key: '06b9874656622c1324ec804581f7e66c0e233e2f', color: loaderColor }))));
|
|
309
310
|
}
|
|
310
311
|
handleClick(ev) {
|
|
311
312
|
if (this.loading || this.disabled) {
|
|
@@ -321,8 +322,8 @@ export class Button {
|
|
|
321
322
|
return (h("p-icon", { class: icon({
|
|
322
323
|
size: this.size,
|
|
323
324
|
variant: this.variant,
|
|
324
|
-
disabled: this.disabled,
|
|
325
|
-
active: this.active,
|
|
325
|
+
disabled: asBoolean(this.disabled),
|
|
326
|
+
active: asBoolean(this.active),
|
|
326
327
|
}), variant: this.icon, flip: this.iconFlip, rotate: this.iconRotate }));
|
|
327
328
|
}
|
|
328
329
|
static get is() { return "p-button"; }
|