vueless 0.0.95 → 0.0.97

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -7,8 +7,8 @@ export default /*tw*/ {
7
7
  },
8
8
  },
9
9
  },
10
- headerCheckboxWrapper: "w-[3.75rem]",
11
- header: "border-b border-gray-200 ",
10
+ headerCheckboxWrapper: "",
11
+ header: "border-b border-gray-200",
12
12
  headerRow: "",
13
13
  headerCell: "p-4 text-sm font-normal text-gray-500 text-left",
14
14
  headerSelectAllCheckbox: "",
@@ -17,17 +17,10 @@ export default /*tw*/ {
17
17
  stickyHeaderLoader: "absolute top-[3.75rem] group-[]/table-compact:!top-[3.25rem]",
18
18
  stickyHeaderActive: "fixed top-0 border border-gray-200 bg-white rounded-none",
19
19
  stickyHeaderActions: "rounded-t-lg border border-blue-200 !bg-blue-50",
20
- stickyHeaderColumn: {
21
- base: "flex-none text-sm font-normal text-gray-500 px-[1.125rem] py-4 [&:nth-child(2)]:pl-0",
22
- variants: {
23
- compact: {
24
- true: "!p-4 [&:nth-child(2)]:!pl-0",
25
- },
26
- },
27
- },
20
+ stickyHeaderColumn: "flex-none text-sm font-normal text-gray-500 p-4",
28
21
  selectedRowsCount: "absolute left-11 pr-2 font-medium text-sm text-gray-900 bg-gradient-to-r from-white from-80%",
29
22
  selectAllCheckbox: "flex-none text-sm font-normal text-gray-500 pr-[1.125rem] pl-4 py-4 group-[]/table-compact:!px-4",
30
- innerWrapper: "overflow-auto rounded-lg border border-gray-200",
23
+ innerWrapper: "overflow-visible rounded-lg border border-gray-200",
31
24
  innerWrapperSelected: "!rounded-t-none border-t-0",
32
25
  table: "min-w-full border-none text-sm w-full",
33
26
  tableLoader: "absolute !top-auto",
@@ -45,8 +38,8 @@ export default /*tw*/ {
45
38
  collapseIconName: "remove",
46
39
  body: "group/body divide-none",
47
40
  bodyRow: "hover:bg-gray-50",
48
- checkboxBodyWrapperCell: "w-[3.75rem] py-3 px-4 align-top",
49
- bodyCell: "",
41
+ checkboxBodyWrapperCell: "py-3 px-4 align-top",
42
+ bodyCell: "overflow-visible",
50
43
  tableCheckbox: "",
51
44
  dateSeparator: "",
52
45
  toggleItemButton: "flex relative -top-px",
@@ -7,8 +7,14 @@
7
7
  >
8
8
  <slot />
9
9
 
10
- <div v-bind="labelWrapperAttrs">
11
- <label :for="props.for" :data-cy="`${dataCy}-label`" v-bind="labelAttrs" v-text="label" />
10
+ <div v-if="label || error || description" v-bind="labelWrapperAttrs">
11
+ <label
12
+ v-if="label"
13
+ :for="props.for"
14
+ :data-cy="`${dataCy}-label`"
15
+ v-bind="labelAttrs"
16
+ v-text="label"
17
+ />
12
18
 
13
19
  <div
14
20
  v-if="error"
@@ -30,6 +36,7 @@
30
36
 
31
37
  <div v-else v-bind="wrapperAttrs">
32
38
  <label
39
+ v-if="label"
33
40
  ref="labelRef"
34
41
  :for="props.for"
35
42
  :data-cy="`${dataCy}-label`"
@@ -0,0 +1,32 @@
1
+ import useUI from "../../composable.ui";
2
+ import { cva } from "../../service.ui";
3
+
4
+ import defaultConfig from "../configs/default.config";
5
+ import { computed } from "vue";
6
+
7
+ export function useAttrs(props) {
8
+ const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
9
+ const { progress } = config.value;
10
+
11
+ const cvaProgress = cva({
12
+ base: progress.base,
13
+ variants: progress.variants,
14
+ compoundVariants: progress.compoundVariants,
15
+ });
16
+
17
+ const progressClasses = computed(() =>
18
+ setColor(
19
+ cvaProgress({
20
+ size: props.size,
21
+ color: props.color,
22
+ }),
23
+ props.color,
24
+ ),
25
+ );
26
+
27
+ const progressAttrs = getAttrs("progress", { classes: progressClasses });
28
+
29
+ return {
30
+ progressAttrs,
31
+ };
32
+ }
@@ -0,0 +1,34 @@
1
+ export default /*tw*/ {
2
+ progress: {
3
+ base: `
4
+ block appearance-none border-none overflow-hidden w-full
5
+ [&::-webkit-progress-bar]:w-full h-2 rounded-full [&::-webkit-progress-bar]:rounded-full
6
+ [&::-webkit-progress-bar]:bg-{color}-200 [@supports(selector(&::-moz-progress-bar))]:bg-{color}-200
7
+ [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:transition-all
8
+ [&::-webkit-progress-value]:ease-in-out [&::-moz-progress-bar]:rounded-full text-{color}-500
9
+ [&::-webkit-progress-value]:bg-current [&::-moz-progress-bar]:bg-current indeterminate:relative
10
+ indeterminate:after:rounded-full [&:indeterminate::-webkit-progress-value]:rounded-full
11
+ [&:indeterminate::-moz-progress-bar]:rounded-full
12
+ `,
13
+ variants: {
14
+ color: {
15
+ white: "bg-white",
16
+ grayscale: "bg-gray-900",
17
+ },
18
+ size: {
19
+ "2xs": "h-px",
20
+ xs: "h-0.5",
21
+ sm: "h-1",
22
+ md: "h-2",
23
+ lg: "h-3",
24
+ xl: "h-4",
25
+ "2xl": "h-5",
26
+ },
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ color: "green",
31
+ size: "md",
32
+ },
33
+ safelist: (colors) => [{ pattern: `bg-(${colors})-200` }, { pattern: `text-(${colors})-500` }],
34
+ };
@@ -0,0 +1,5 @@
1
+ /*
2
+ This const is needed to prevent the issue in script setup:
3
+ `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
+ */
5
+ export const UProgress = "UProgress";
@@ -0,0 +1,42 @@
1
+ import UProgress from "./index.vue";
2
+ import UButton from "../ui.button/index.vue";
3
+
4
+ import { getArgTypes } from "../service.storybook";
5
+
6
+ export default {
7
+ id: "9015",
8
+ title: "Other / Progress",
9
+ component: UProgress,
10
+ argTypes: {
11
+ ...getArgTypes(UProgress.name),
12
+ },
13
+ };
14
+
15
+ const DefaultTemplate = (args) => ({
16
+ components: { UProgress, UButton },
17
+ setup() {
18
+ return { args };
19
+ },
20
+ data() {
21
+ return {
22
+ progress: 10,
23
+ };
24
+ },
25
+ methods: {
26
+ updateProgress() {
27
+ this.progress += 10;
28
+
29
+ if (this.progress > 100) {
30
+ this.progress = 0;
31
+ }
32
+ },
33
+ },
34
+ template: `
35
+ <UProgress :value="progress" />
36
+
37
+ <UButton class="mt-4" @click="updateProgress">Update Progress</UButton>
38
+ `,
39
+ });
40
+
41
+ export const Default = DefaultTemplate.bind({});
42
+ Default.args = {};
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <progress v-bind="progressAttrs" :max="max" :value="value" />
3
+ </template>
4
+
5
+ <script setup>
6
+ import UIService from "../service.ui";
7
+
8
+ import { UProgress } from "./constants";
9
+ import defaultConfig from "./configs/default.config";
10
+ import { useAttrs } from "./composables/attrs.composable";
11
+
12
+ /* Should be a string for correct web-types gen */
13
+ defineOptions({ name: "UProgress", inheritAttrs: false });
14
+
15
+ const props = defineProps({
16
+ value: {
17
+ type: Number,
18
+ required: true,
19
+ default: 0,
20
+ },
21
+ max: {
22
+ type: Number,
23
+ default: 100,
24
+ },
25
+ size: {
26
+ type: String,
27
+ default: UIService.get(defaultConfig, UProgress).default.size,
28
+ },
29
+ color: {
30
+ type: String,
31
+ default: UIService.get(defaultConfig, UProgress).default.color,
32
+ },
33
+ });
34
+
35
+ const { progressAttrs } = useAttrs(props);
36
+ </script>
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.95",
4
+ "version": "0.0.97",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -5444,6 +5444,49 @@
5444
5444
  "symbol": "default"
5445
5445
  }
5446
5446
  },
5447
+ {
5448
+ "name": "UProgress",
5449
+ "description": "",
5450
+ "attributes": [
5451
+ {
5452
+ "name": "value",
5453
+ "required": true,
5454
+ "value": {
5455
+ "kind": "expression",
5456
+ "type": "number"
5457
+ },
5458
+ "default": "0"
5459
+ },
5460
+ {
5461
+ "name": "max",
5462
+ "value": {
5463
+ "kind": "expression",
5464
+ "type": "number"
5465
+ },
5466
+ "default": "100"
5467
+ },
5468
+ {
5469
+ "name": "size",
5470
+ "value": {
5471
+ "kind": "expression",
5472
+ "type": "string"
5473
+ },
5474
+ "default": "md"
5475
+ },
5476
+ {
5477
+ "name": "color",
5478
+ "value": {
5479
+ "kind": "expression",
5480
+ "type": "string"
5481
+ },
5482
+ "default": "green"
5483
+ }
5484
+ ],
5485
+ "source": {
5486
+ "module": "vueless/ui.progress/index.vue",
5487
+ "symbol": "default"
5488
+ }
5489
+ },
5447
5490
  {
5448
5491
  "name": "URadio",
5449
5492
  "description": "",