@pequity/squirrel 1.0.20 → 1.0.21-beta.1

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.
Files changed (146) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -0
  2. package/dist/cjs/chunks/p-action-bar.js +60 -0
  3. package/dist/cjs/chunks/p-card.js +28 -0
  4. package/dist/cjs/chunks/p-checkbox.js +24 -0
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -0
  6. package/dist/cjs/chunks/p-input-percent.js +53 -0
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -0
  8. package/dist/cjs/chunks/p-pagination.js +122 -0
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -0
  10. package/dist/cjs/chunks/p-select-btn.js +97 -0
  11. package/dist/cjs/chunks/p-select.js +123 -0
  12. package/dist/cjs/chunks/p-table-loader.js +70 -0
  13. package/dist/cjs/chunks/p-tabs.js +52 -0
  14. package/dist/cjs/config.js +105 -0
  15. package/dist/cjs/currency.js +9 -0
  16. package/dist/cjs/dom.js +27 -0
  17. package/dist/cjs/index.js +976 -0
  18. package/dist/cjs/inputClassesMixin.js +50 -0
  19. package/dist/cjs/inputClassesShared.js +76 -0
  20. package/dist/cjs/listKeyboardNavigation.js +110 -0
  21. package/dist/cjs/number.js +9 -0
  22. package/dist/cjs/object.js +4 -0
  23. package/dist/cjs/p-action-bar.js +3 -0
  24. package/dist/cjs/p-alert.js +65 -0
  25. package/dist/cjs/p-avatar.js +71 -0
  26. package/dist/cjs/p-btn.js +361 -0
  27. package/dist/cjs/p-card.js +3 -0
  28. package/dist/cjs/p-checkbox.js +3 -0
  29. package/dist/cjs/p-chips.js +110 -0
  30. package/dist/cjs/p-close-btn.js +36 -0
  31. package/dist/cjs/p-date-picker.js +139 -0
  32. package/dist/cjs/p-drawer.js +253 -0
  33. package/dist/cjs/p-dropdown-select.js +3 -0
  34. package/dist/cjs/p-dropdown.js +138 -0
  35. package/dist/cjs/p-file-upload.js +21 -0
  36. package/dist/cjs/p-info-icon.js +35 -0
  37. package/dist/cjs/p-inline-date-picker.js +142 -0
  38. package/dist/cjs/p-input-number.js +146 -0
  39. package/dist/cjs/p-input-percent.js +3 -0
  40. package/dist/cjs/p-input-search.js +110 -0
  41. package/dist/cjs/p-input.js +89 -0
  42. package/dist/cjs/p-loading.js +38 -0
  43. package/dist/cjs/p-modal.js +369 -0
  44. package/dist/cjs/p-pagination-info.js +3 -0
  45. package/dist/cjs/p-pagination.js +3 -0
  46. package/dist/cjs/p-progress-bar.js +41 -0
  47. package/dist/cjs/p-ring-loader.js +3 -0
  48. package/dist/cjs/p-select-btn.js +3 -0
  49. package/dist/cjs/p-select-list.js +4 -0
  50. package/dist/cjs/p-select-pill.js +111 -0
  51. package/dist/cjs/p-select.js +3 -0
  52. package/dist/cjs/p-skeleton-loader.js +73 -0
  53. package/dist/cjs/p-table-filter-icon.js +20 -0
  54. package/dist/cjs/p-table-header-cell.js +75 -0
  55. package/dist/cjs/p-table-loader.js +3 -0
  56. package/dist/cjs/p-table-sort.js +8 -0
  57. package/dist/cjs/p-table-td.js +88 -0
  58. package/dist/cjs/p-table.js +12 -0
  59. package/dist/cjs/p-tabs.js +3 -0
  60. package/dist/cjs/p-textarea.js +73 -0
  61. package/dist/cjs/p-toggle.js +114 -0
  62. package/dist/cjs/pagination.js +29 -0
  63. package/dist/cjs/string.js +12 -0
  64. package/dist/cjs/tailwind.js +4353 -0
  65. package/dist/cjs/text.js +16 -0
  66. package/dist/cjs/useInputClasses.js +44 -0
  67. package/dist/cjs/usePLoading.js +35 -0
  68. package/dist/cjs/usePModal.js +21 -0
  69. package/dist/cjs/usePTableColResize.js +81 -0
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -0
  71. package/dist/cjs/useSelectList.js +256 -0
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
  73. package/dist/es/chunks/p-action-bar.js +61 -0
  74. package/dist/es/chunks/p-card.js +29 -0
  75. package/dist/es/chunks/p-checkbox.js +25 -0
  76. package/dist/es/chunks/p-dropdown-select.js +415 -0
  77. package/dist/es/chunks/p-input-percent.js +54 -0
  78. package/dist/es/chunks/p-pagination-info.js +67 -0
  79. package/dist/es/chunks/p-pagination.js +123 -0
  80. package/dist/es/chunks/p-ring-loader.js +82 -0
  81. package/dist/es/chunks/p-select-btn.js +98 -0
  82. package/dist/es/chunks/p-select.js +124 -0
  83. package/dist/es/chunks/p-table-loader.js +71 -0
  84. package/dist/es/chunks/p-tabs.js +53 -0
  85. package/dist/es/config.js +105 -0
  86. package/dist/es/currency.js +9 -0
  87. package/dist/es/dom.js +27 -0
  88. package/dist/es/index.js +978 -0
  89. package/dist/es/inputClassesMixin.js +51 -0
  90. package/dist/es/inputClassesShared.js +76 -0
  91. package/dist/es/listKeyboardNavigation.js +110 -0
  92. package/dist/es/number.js +9 -0
  93. package/dist/es/object.js +4 -0
  94. package/dist/es/p-action-bar.js +4 -0
  95. package/dist/es/p-alert.js +66 -0
  96. package/dist/es/p-avatar.js +72 -0
  97. package/dist/es/p-btn.js +362 -0
  98. package/dist/es/p-card.js +4 -0
  99. package/dist/es/p-checkbox.js +4 -0
  100. package/dist/es/p-chips.js +111 -0
  101. package/dist/es/p-close-btn.js +37 -0
  102. package/dist/es/p-date-picker.js +140 -0
  103. package/dist/es/p-drawer.js +254 -0
  104. package/dist/es/p-dropdown-select.js +4 -0
  105. package/dist/es/p-dropdown.js +139 -0
  106. package/dist/es/p-file-upload.js +21 -0
  107. package/dist/es/p-info-icon.js +36 -0
  108. package/dist/es/p-inline-date-picker.js +143 -0
  109. package/dist/es/p-input-number.js +147 -0
  110. package/dist/es/p-input-percent.js +4 -0
  111. package/dist/es/p-input-search.js +111 -0
  112. package/dist/es/p-input.js +90 -0
  113. package/dist/es/p-loading.js +39 -0
  114. package/dist/es/p-modal.js +370 -0
  115. package/dist/es/p-pagination-info.js +4 -0
  116. package/dist/es/p-pagination.js +4 -0
  117. package/dist/es/p-progress-bar.js +42 -0
  118. package/dist/es/p-ring-loader.js +4 -0
  119. package/dist/es/p-select-btn.js +4 -0
  120. package/dist/es/p-select-list.js +4 -0
  121. package/dist/es/p-select-pill.js +112 -0
  122. package/dist/es/p-select.js +4 -0
  123. package/dist/es/p-skeleton-loader.js +74 -0
  124. package/dist/es/p-table-filter-icon.js +21 -0
  125. package/dist/es/p-table-header-cell.js +76 -0
  126. package/dist/es/p-table-loader.js +4 -0
  127. package/dist/es/p-table-sort.js +8 -0
  128. package/dist/es/p-table-td.js +89 -0
  129. package/dist/es/p-table.js +12 -0
  130. package/dist/es/p-tabs.js +4 -0
  131. package/dist/es/p-textarea.js +74 -0
  132. package/dist/es/p-toggle.js +115 -0
  133. package/dist/es/pagination.js +29 -0
  134. package/dist/es/string.js +12 -0
  135. package/dist/es/tailwind.js +4353 -0
  136. package/dist/es/text.js +16 -0
  137. package/dist/es/useInputClasses.js +44 -0
  138. package/dist/es/usePLoading.js +35 -0
  139. package/dist/es/usePModal.js +21 -0
  140. package/dist/es/usePTableColResize.js +81 -0
  141. package/dist/es/usePTableRowVirtualizer.js +31 -0
  142. package/dist/es/useSelectList.js +256 -0
  143. package/dist/style.css +2124 -1
  144. package/package.json +26 -24
  145. package/dist/squirrel.cjs.js +0 -5
  146. package/dist/squirrel.es.js +0 -8220
@@ -0,0 +1,82 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass } from "vue";
2
+ import { getColor } from "../tailwind.js";
3
+ const INNER_DIV_CLASS = "block animate-spin absolute box-border rounded-full w-4/5 h-4/5 m-[10%]";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{
6
+ name: "PRingLoader"
7
+ },
8
+ __name: "p-ring-loader",
9
+ props: {
10
+ size: {
11
+ type: Number,
12
+ default: 80
13
+ },
14
+ color: {
15
+ type: String,
16
+ default: getColor("primary")
17
+ },
18
+ duration: {
19
+ type: String,
20
+ default: "1.2s",
21
+ validator(value) {
22
+ const res = /^\d*\.?\d+(s|ms)$/;
23
+ return res.test(value);
24
+ }
25
+ }
26
+ },
27
+ setup(__props) {
28
+ const calcPropertyValue = (propName, originalValue, modificator) => {
29
+ var _a, _b;
30
+ const computedStyle = {};
31
+ const timeQuantityOuter = (_a = originalValue.match(/^\d*\.?\d+/)) == null ? void 0 : _a[0];
32
+ const timeUnit = ((_b = originalValue.match(/s|(ms)$/)) == null ? void 0 : _b[0]) || "s";
33
+ const timeQuantityInner = Math.round(Number(timeQuantityOuter) * 1e3 * modificator) / 1e3;
34
+ computedStyle[propName] = timeQuantityInner + timeUnit;
35
+ return computedStyle;
36
+ };
37
+ const props = __props;
38
+ const spinnerStyle = computed(() => {
39
+ return {
40
+ borderWidth: `${props.size * 0.1}px`,
41
+ borderColor: `${props.color} transparent transparent transparent`,
42
+ animationDuration: props.duration,
43
+ animationTimingFunction: "cubic-bezier(0.5, 0, 0.5, 1)"
44
+ };
45
+ });
46
+ const animDiv1 = computed(() => {
47
+ return calcPropertyValue("animationDelay", props.duration, -0.375);
48
+ });
49
+ const animDiv2 = computed(() => {
50
+ return calcPropertyValue("animationDelay", props.duration, -0.25);
51
+ });
52
+ const animDiv3 = computed(() => {
53
+ return calcPropertyValue("animationDelay", props.duration, -0.125);
54
+ });
55
+ return (_ctx, _cache) => {
56
+ return openBlock(), createElementBlock("div", {
57
+ class: "relative inline-block",
58
+ style: normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
59
+ }, [
60
+ createElementVNode("div", {
61
+ class: normalizeClass(INNER_DIV_CLASS),
62
+ style: normalizeStyle([spinnerStyle.value, animDiv1.value])
63
+ }, null, 4),
64
+ createElementVNode("div", {
65
+ class: normalizeClass(INNER_DIV_CLASS),
66
+ style: normalizeStyle([spinnerStyle.value, animDiv2.value])
67
+ }, null, 4),
68
+ createElementVNode("div", {
69
+ class: normalizeClass(INNER_DIV_CLASS),
70
+ style: normalizeStyle([spinnerStyle.value, animDiv3.value])
71
+ }, null, 4),
72
+ createElementVNode("div", {
73
+ class: normalizeClass(INNER_DIV_CLASS),
74
+ style: normalizeStyle([spinnerStyle.value])
75
+ }, null, 4)
76
+ ], 4);
77
+ };
78
+ }
79
+ });
80
+ export {
81
+ _sfc_main as _
82
+ };
@@ -0,0 +1,98 @@
1
+ import { defineComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, Fragment, renderList, withDirectives, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
2
+ import PBtn from "../p-btn.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{
5
+ name: "PBtnGroup"
6
+ },
7
+ __name: "p-select-btn",
8
+ props: {
9
+ modelValue: { default: null },
10
+ items: { default: () => [] },
11
+ itemValue: { default: "value" },
12
+ itemText: { default: "text" },
13
+ itemTooltipText: { default: "text" },
14
+ size: { default: "md" },
15
+ showTooltip: { type: Boolean, default: false },
16
+ highlightSelected: { type: Boolean, default: true },
17
+ grow: { type: Boolean, default: false },
18
+ multiple: { type: Boolean, default: false },
19
+ noPadding: { type: Boolean, default: false }
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(__props, { emit: __emit }) {
23
+ const emit = __emit;
24
+ const props = __props;
25
+ const tooltipText = (item) => {
26
+ return props.showTooltip ? item[props.itemTooltipText] : "";
27
+ };
28
+ const select = (item) => {
29
+ if (!props.multiple) {
30
+ emit("update:modelValue", item[props.itemValue]);
31
+ } else {
32
+ if (Array.isArray(props.modelValue)) {
33
+ const val = item[props.itemValue];
34
+ const index = props.modelValue.findIndex((i) => i[props.itemValue] === val);
35
+ if (index !== -1) {
36
+ emit(
37
+ "update:modelValue",
38
+ props.modelValue.filter((i) => i[props.itemValue] !== val)
39
+ );
40
+ } else {
41
+ emit("update:modelValue", [...props.modelValue, item]);
42
+ }
43
+ } else {
44
+ emit("update:modelValue", [item]);
45
+ }
46
+ }
47
+ };
48
+ const isSelected = (item) => {
49
+ if (!props.multiple) {
50
+ return props.modelValue === item[props.itemValue];
51
+ } else {
52
+ if (Array.isArray(props.modelValue)) {
53
+ const index = props.modelValue.findIndex((i) => i[props.itemValue] === item[props.itemValue]);
54
+ return index !== -1;
55
+ }
56
+ }
57
+ };
58
+ return (_ctx, _cache) => {
59
+ const _directive_tooltip = resolveDirective("tooltip");
60
+ return openBlock(), createElementBlock("div", {
61
+ class: normalizeClass({ flex: _ctx.grow, "*:px-0 *:py-0": _ctx.noPadding })
62
+ }, [
63
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index) => {
64
+ return withDirectives((openBlock(), createBlock(PBtn, {
65
+ key: item[_ctx.itemValue],
66
+ size: _ctx.size,
67
+ type: "secondary-outline-blue",
68
+ disabled: item.disabled,
69
+ class: normalizeClass({
70
+ "rounded-none": index !== 0 && index !== _ctx.items.length - 1,
71
+ "rounded-br-none rounded-tr-none": index === 0,
72
+ "rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1,
73
+ "-mr-0.5": index !== _ctx.items.length - 1,
74
+ "flex-1": _ctx.grow
75
+ }),
76
+ selected: isSelected(item) && _ctx.highlightSelected,
77
+ onClick: ($event) => select(item)
78
+ }, {
79
+ default: withCtx(() => [
80
+ renderSlot(_ctx.$slots, `btn-${index}`, {
81
+ item,
82
+ isSelected: isSelected(item)
83
+ }, () => [
84
+ createTextVNode(toDisplayString(item[_ctx.itemText]), 1)
85
+ ])
86
+ ]),
87
+ _: 2
88
+ }, 1032, ["size", "disabled", "class", "selected", "onClick"])), [
89
+ [_directive_tooltip, { content: tooltipText(item) }]
90
+ ]);
91
+ }), 128))
92
+ ], 2);
93
+ };
94
+ }
95
+ });
96
+ export {
97
+ _sfc_main as _
98
+ };
@@ -0,0 +1,124 @@
1
+ import { defineComponent, useAttrs, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot, toDisplayString, createCommentVNode, createElementVNode, mergeProps, Fragment, renderList, withDirectives, vShow } from "vue";
2
+ import { INPUT_SIZES } from "../inputClassesShared.js";
3
+ import { useInputClasses } from "../useInputClasses.js";
4
+ const _hoisted_1 = ["data-has-error"];
5
+ const _hoisted_2 = ["value"];
6
+ const _hoisted_3 = ["value"];
7
+ const nullValue = "___null_value___";
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ ...{
10
+ name: "PSelect",
11
+ inheritAttrs: false
12
+ },
13
+ __name: "p-select",
14
+ props: {
15
+ modelValue: {
16
+ type: [String, Number, Boolean, null],
17
+ default: ""
18
+ },
19
+ items: {
20
+ type: Array,
21
+ default: () => []
22
+ },
23
+ label: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ errorMsg: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ required: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ size: {
36
+ type: String,
37
+ default: "md",
38
+ validator(value) {
39
+ return Object.keys(INPUT_SIZES).includes(value);
40
+ }
41
+ },
42
+ itemText: {
43
+ type: String,
44
+ default: "text"
45
+ },
46
+ itemValue: {
47
+ type: [String, Number, Boolean, null],
48
+ default: "value"
49
+ }
50
+ },
51
+ emits: ["update:modelValue"],
52
+ setup(__props, { emit: __emit }) {
53
+ const emit = __emit;
54
+ const props = __props;
55
+ const $attrs = useAttrs();
56
+ const { labelClasses, selectClasses, errorMsgClasses } = useInputClasses(props);
57
+ const innerValue = computed({
58
+ get: () => {
59
+ if (props.modelValue === null) {
60
+ return nullValue;
61
+ }
62
+ return props.modelValue;
63
+ },
64
+ set: (v) => emit("update:modelValue", v)
65
+ });
66
+ const attrs = computed(() => {
67
+ const { class: classes, style: style2, ...rest } = $attrs;
68
+ return rest;
69
+ });
70
+ const style = computed(() => $attrs.style);
71
+ const innerOptions = computed(() => {
72
+ return props.items.map((item) => {
73
+ return {
74
+ value: item[props.itemValue] === null ? nullValue : item[props.itemValue],
75
+ text: item[props.itemText]
76
+ };
77
+ });
78
+ });
79
+ const onChange = (e) => {
80
+ const value = e.target.value;
81
+ if (value === nullValue) {
82
+ emit("update:modelValue", null);
83
+ return;
84
+ }
85
+ emit("update:modelValue", ["true", "false"].includes(value) ? value === "true" : value);
86
+ };
87
+ return (_ctx, _cache) => {
88
+ return openBlock(), createElementBlock("div", {
89
+ class: normalizeClass([{ hidden: unref($attrs).hidden }, unref($attrs).class]),
90
+ "data-has-error": !!__props.errorMsg,
91
+ style: normalizeStyle(style.value)
92
+ }, [
93
+ renderSlot(_ctx.$slots, "label", {
94
+ label: __props.label,
95
+ labelClasses: unref(labelClasses)
96
+ }, () => [
97
+ __props.label ? (openBlock(), createElementBlock("label", {
98
+ key: 0,
99
+ class: normalizeClass(unref(labelClasses))
100
+ }, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
101
+ ]),
102
+ createElementVNode("select", mergeProps({ class: unref(selectClasses) }, attrs.value, {
103
+ value: innerValue.value,
104
+ onChange
105
+ }), [
106
+ (openBlock(true), createElementBlock(Fragment, null, renderList(innerOptions.value, (o) => {
107
+ return openBlock(), createElementBlock("option", {
108
+ key: String(o.value),
109
+ value: o.value
110
+ }, toDisplayString(o.text), 9, _hoisted_3);
111
+ }), 128))
112
+ ], 16, _hoisted_2),
113
+ withDirectives(createElementVNode("div", {
114
+ class: normalizeClass(unref(errorMsgClasses))
115
+ }, toDisplayString(__props.errorMsg), 3), [
116
+ [vShow, __props.errorMsg]
117
+ ])
118
+ ], 14, _hoisted_1);
119
+ };
120
+ }
121
+ });
122
+ export {
123
+ _sfc_main as _
124
+ };
@@ -0,0 +1,71 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, normalizeClass } from "vue";
2
+ import PSkeletonLoader from "../p-skeleton-loader.js";
3
+ const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30" };
4
+ const _hoisted_2 = { class: "mb-0 w-full bg-surface" };
5
+ const _hoisted_3 = { class: "relative border-b border-p-gray-30 px-4 py-2" };
6
+ const _hoisted_4 = { class: "skeleton-fade" };
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ ...{
9
+ name: "PTableLoader"
10
+ },
11
+ __name: "p-table-loader",
12
+ props: {
13
+ rows: {
14
+ type: [Number, String],
15
+ default: 4
16
+ },
17
+ columns: {
18
+ type: [Number, String],
19
+ default: 6
20
+ },
21
+ tdClasses: {
22
+ type: String,
23
+ default: "px-4 py-5"
24
+ },
25
+ tdSkeletonClasses: {
26
+ type: String,
27
+ default: "h-5"
28
+ }
29
+ },
30
+ setup(__props) {
31
+ return (_ctx, _cache) => {
32
+ return openBlock(), createElementBlock("div", _hoisted_1, [
33
+ createElementVNode("table", _hoisted_2, [
34
+ createElementVNode("thead", null, [
35
+ createElementVNode("tr", null, [
36
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Number(__props.columns), (col) => {
37
+ return openBlock(), createElementBlock("th", {
38
+ key: col,
39
+ class: "bg-surface p-0"
40
+ }, [
41
+ createElementVNode("div", _hoisted_3, [
42
+ createVNode(PSkeletonLoader, { class: "h-5" })
43
+ ])
44
+ ]);
45
+ }), 128))
46
+ ])
47
+ ]),
48
+ createElementVNode("tbody", _hoisted_4, [
49
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Number(__props.rows), (i) => {
50
+ return openBlock(), createElementBlock("tr", { key: i }, [
51
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Number(__props.columns), (col) => {
52
+ return openBlock(), createElementBlock("td", {
53
+ key: col,
54
+ class: normalizeClass([__props.tdClasses, "border-b border-p-blue-15"])
55
+ }, [
56
+ createVNode(PSkeletonLoader, {
57
+ class: normalizeClass(__props.tdSkeletonClasses)
58
+ }, null, 8, ["class"])
59
+ ], 2);
60
+ }), 128))
61
+ ]);
62
+ }), 128))
63
+ ])
64
+ ])
65
+ ]);
66
+ };
67
+ }
68
+ });
69
+ export {
70
+ _sfc_main as _
71
+ };
@@ -0,0 +1,53 @@
1
+ import { defineComponent, openBlock, createElementBlock, normalizeStyle, Fragment, renderList, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementVNode, normalizeClass, createCommentVNode, toDisplayString } from "vue";
2
+ const _hoisted_1 = { class: "flex items-center gap-2" };
3
+ const _hoisted_2 = { key: 0 };
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "p-tabs",
6
+ props: {
7
+ tabs: {
8
+ type: Array,
9
+ required: true
10
+ },
11
+ activeTab: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ tabsLeftPadding: {
16
+ type: Number,
17
+ default: 0
18
+ }
19
+ },
20
+ emits: ["click:tab"],
21
+ setup(__props) {
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock("div", {
24
+ class: "flex gap-4 border-b border-p-gray-30 text-base font-semibold",
25
+ style: normalizeStyle({ paddingLeft: `${__props.tabsLeftPadding}px` })
26
+ }, [
27
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.tabs, (tabData) => {
28
+ return openBlock(), createBlock(resolveDynamicComponent(tabData.to ? "RouterLink" : "div"), mergeProps({
29
+ key: `tab-${tabData.name}`
30
+ }, tabData.to ? { to: tabData.to } : {}, {
31
+ class: [[__props.activeTab === tabData.name ? "border-primary text-primary" : "border-transparent text-p-gray-40"], "group cursor-pointer border-b-2 pb-3 hover:border-primary hover:text-primary"],
32
+ onClick: ($event) => _ctx.$emit("click:tab", tabData.name)
33
+ }), {
34
+ default: withCtx(() => [
35
+ createElementVNode("div", _hoisted_1, [
36
+ tabData.icon ? (openBlock(), createElementBlock("div", _hoisted_2, [
37
+ (openBlock(), createBlock(resolveDynamicComponent(tabData.icon), {
38
+ class: normalizeClass(["group-hover:fill-primary", [__props.activeTab === tabData.name ? "fill-primary" : "fill-p-gray-40"]])
39
+ }, null, 8, ["class"]))
40
+ ])) : createCommentVNode("", true),
41
+ createElementVNode("div", null, toDisplayString(tabData.title), 1)
42
+ ])
43
+ ]),
44
+ _: 2
45
+ }, 1040, ["class", "onClick"]);
46
+ }), 128))
47
+ ], 4);
48
+ };
49
+ }
50
+ });
51
+ export {
52
+ _sfc_main as _
53
+ };
@@ -0,0 +1,105 @@
1
+ const config = {
2
+ content: ["./index.html", "./squirrel/**/*.{vue,js,ts,jsx,tsx,mdx}", "./src/**/*.{vue,js,ts,jsx,tsx,mdx}"],
3
+ theme: {
4
+ colors: {
5
+ transparent: "transparent",
6
+ current: "currentColor",
7
+ /* Design system colors */
8
+ white: "#fff",
9
+ black: "#000",
10
+ night: "var(--color-night)",
11
+ "barley-white": "var(--color-barley-white)",
12
+ "horses-neck": "var(--color-horses-neck)",
13
+ "active-blue": "var(--color-active-blue)",
14
+ /* Pequity colors */
15
+ "p-gray": {
16
+ 10: "var(--color-p-gray-10)",
17
+ 20: "var(--color-p-gray-20)",
18
+ 30: "var(--color-p-gray-30)",
19
+ 40: "var(--color-p-gray-40)",
20
+ 50: "var(--color-p-gray-50)",
21
+ 60: "var(--color-p-gray-60)",
22
+ 70: "var(--color-p-gray-70)",
23
+ 80: "var(--color-p-gray-80)",
24
+ 90: "var(--color-p-gray-90)",
25
+ 100: "var(--color-p-gray-100)"
26
+ },
27
+ "p-blue": {
28
+ 10: "var(--color-p-blue-10)",
29
+ 15: "var(--color-p-blue-15)",
30
+ 20: "var(--color-p-blue-20)",
31
+ 30: "var(--color-p-blue-30)",
32
+ 40: "var(--color-p-blue-40)",
33
+ 50: "var(--color-p-blue-50)",
34
+ 60: "var(--color-p-blue-60)",
35
+ 70: "var(--color-p-blue-70)",
36
+ 80: "var(--color-p-blue-80)"
37
+ },
38
+ "p-purple": {
39
+ 10: "var(--color-p-purple-10)",
40
+ 20: "var(--color-p-purple-20)",
41
+ 30: "var(--color-p-purple-30)",
42
+ 40: "var(--color-p-purple-40)",
43
+ 50: "var(--color-p-purple-50)",
44
+ 60: "var(--color-p-purple-60)"
45
+ },
46
+ "p-green": {
47
+ 10: "var(--color-p-green-10)",
48
+ 20: "var(--color-p-green-20)",
49
+ 30: "var(--color-p-green-30)",
50
+ 40: "var(--color-p-green-40)",
51
+ 50: "var(--color-p-green-50)"
52
+ },
53
+ "p-red": {
54
+ 10: "var(--color-p-red-10)",
55
+ 20: "var(--color-p-red-20)",
56
+ 30: "var(--color-p-red-30)",
57
+ 40: "var(--color-p-red-40)",
58
+ 50: "var(--color-p-red-50)"
59
+ },
60
+ /* Aliases */
61
+ primary: "var(--color-primary)",
62
+ accent: "var(--color-accent)",
63
+ surface: "var(--color-surface)",
64
+ "on-surface": "var(--color-on-surface)",
65
+ error: "var(--color-error)",
66
+ "on-error": "var(--color-on-error)",
67
+ info: "var(--color-info)",
68
+ "on-info": "var(--color-on-info)",
69
+ success: "var(--color-success)",
70
+ "on-success": "var(--color-on-success)",
71
+ warning: "var(--color-warning)",
72
+ "on-warning": "var(--color-on-warning)"
73
+ },
74
+ fontFamily: {
75
+ sans: ["Inter", "Helvetica", "Arial", "sans-serif"]
76
+ },
77
+ fontSize: {
78
+ xs: "0.75rem",
79
+ sm: "0.875rem",
80
+ base: "1rem",
81
+ lg: "1.125rem",
82
+ xl: "1.25rem",
83
+ "2xl": "1.5rem",
84
+ "3xl": "1.875rem",
85
+ "4xl": "2.25rem",
86
+ "5xl": "3rem",
87
+ "6xl": "4rem"
88
+ },
89
+ extend: {
90
+ borderColor: {
91
+ DEFAULT: "var(--color-p-gray-30)"
92
+ },
93
+ spacing: {
94
+ 7.5: "1.875rem"
95
+ },
96
+ zIndex: {
97
+ 110: "110"
98
+ },
99
+ screens: {}
100
+ }
101
+ }
102
+ };
103
+ export {
104
+ config
105
+ };
@@ -0,0 +1,9 @@
1
+ const CURRENCY_INPUT_DEFAULTS = Object.freeze({
2
+ currency: null,
3
+ precision: 0,
4
+ locale: "en-US",
5
+ allowNegative: false
6
+ });
7
+ export {
8
+ CURRENCY_INPUT_DEFAULTS
9
+ };
package/dist/es/dom.js ADDED
@@ -0,0 +1,27 @@
1
+ const isVisible = (element) => {
2
+ var _a;
3
+ if (!(element instanceof Element)) {
4
+ throw Error("You must provide a DOM element.");
5
+ }
6
+ return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length) && window.getComputedStyle(element).visibility !== "hidden" && window.getComputedStyle(element).display !== "none" && ((_a = element.style) == null ? void 0 : _a.transform.includes("translateY(-9999px)")) === false;
7
+ };
8
+ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
9
+ const listLength = list.length;
10
+ let index = activeElement ? list.indexOf(activeElement) : -1;
11
+ if (index === -1) {
12
+ return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];
13
+ }
14
+ index += shouldGetNext ? 1 : -1;
15
+ if (isCycleAllowed) {
16
+ index = (index + listLength) % listLength;
17
+ }
18
+ return list[Math.max(0, Math.min(index, listLength - 1))];
19
+ };
20
+ const isElement = (el) => {
21
+ return typeof el === "object" && el !== null && "tagName" in el && el instanceof HTMLElement;
22
+ };
23
+ export {
24
+ getNextActiveElement,
25
+ isElement,
26
+ isVisible
27
+ };