plume-ui-react 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +53 -2
- package/dist/chunk-PZGR7IS5.mjs +1 -0
- package/dist/chunk-XCMY6VPH.mjs +1 -0
- package/dist/components/form/datepicker/calendar.mjs +1 -0
- package/dist/components/form/datepicker/datepicker-input.mjs +1 -0
- package/dist/components/form/datepicker/datepicker-reducer.mjs +1 -0
- package/dist/components/form/datepicker/datepicker.mjs +2 -0
- package/dist/components/form/datepicker/index.mjs +1 -0
- package/dist/components/form/datepicker/use-datepicker.mjs +1 -0
- package/dist/components/form/field/field.mjs +1 -0
- package/dist/components/form/field/index.mjs +1 -0
- package/dist/components/form/input/index.mjs +1 -0
- package/dist/components/form/input/input.mjs +2 -0
- package/dist/components/interaction/button/button.mjs +2 -0
- package/dist/components/interaction/button/index.mjs +1 -0
- package/dist/components/navigation/tabs/index.mjs +1 -0
- package/dist/components/navigation/tabs/tab-list.mjs +1 -0
- package/dist/components/navigation/tabs/tab-panel.mjs +1 -0
- package/dist/components/navigation/tabs/tab-panels.mjs +1 -0
- package/dist/components/navigation/tabs/tab.mjs +1 -0
- package/dist/components/navigation/tabs/tabs-reducer.mjs +1 -0
- package/dist/components/navigation/tabs/tabs.mjs +1 -0
- package/dist/components/navigation/tabs/use-tabs.mjs +1 -0
- package/dist/components/presentation/spinner/index.mjs +1 -0
- package/dist/components/presentation/spinner/spinner.mjs +5 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/hooks/use-click-outside.mjs +1 -0
- package/dist/hooks/use-debounce.mjs +1 -0
- package/dist/hooks/use-mask.mjs +1 -0
- package/dist/index.d.mts +374 -0
- package/dist/index.d.ts +374 -0
- package/dist/index.js +8 -0
- package/dist/index.mjs +1 -0
- package/dist/overlay/index.mjs +1 -0
- package/dist/overlay/layer.mjs +1 -0
- package/dist/overlay/portal.mjs +1 -0
- package/dist/overlay/position.mjs +1 -0
- package/dist/overlay/use-dismiss.mjs +1 -0
- package/dist/overlay/use-focus-trap.mjs +1 -0
- package/dist/overlay/use-isomorphic-layout-effect.mjs +1 -0
- package/dist/overlay/use-position.mjs +1 -0
- package/dist/overlay/use-scroll-lock.mjs +1 -0
- package/dist/styles.css +1 -0
- package/dist/theme/config.mjs +1 -0
- package/dist/theme/index.mjs +1 -0
- package/dist/theme/shared.types.mjs +0 -0
- package/dist/theme/shared.utils.mjs +1 -0
- package/dist/theme/theme-provider.mjs +1 -0
- package/dist/theme/theme-root.mjs +1 -0
- package/dist/theme/theme-to-css-vars.mjs +1 -0
- package/dist/theme/theme.types.mjs +0 -0
- package/dist/utils/colors.mjs +1 -0
- package/dist/utils/dates.mjs +1 -0
- package/dist/utils/index.mjs +1 -0
- package/dist/utils/lazy.mjs +1 -0
- package/dist/utils/merge.mjs +1 -0
- package/package.json +86 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(t){let n=c(t)?.groups;return t.startsWith("#")&&n?[parseInt(n.red,16),parseInt(n.green,16),parseInt(n.blue,16)]:u(t)?.map(Number)||[]}function u(t){return t.match(/\d+/g)}function c(t){return/^#?(?<red>[a-f\d]{2})(?<green>[a-f\d]{2})(?<blue>[a-f\d]{2})$/i.exec(t)}function b(t){let n=i(t);if(n.length<3)return"#000000";let[r,g,e]=n;return(r*299+g*587+e*114)/1e3>140?"#000000":"#ffffff"}function a(t){let n=i(t);if(n.length<3)return 0;let[r,g,e]=n.map(s=>{let o=s/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*r+.7152*g+.0722*e}function f(t,n){let r=a(t),g=a(n),[e,s]=r>=g?[r,g]:[g,r];return(e+.05)/(s+.05)}function d(t,n=10){let r=i(t);return r.length<3?t:`rgb(${r.map(e=>Math.min(255,e+(255-e)*(n/100))).join(", ")})`}function h(t,n=10){let r=i(t);return r.length<3?t:`rgb(${r.map(e=>Math.max(0,e-e*n/100)).join(", ")})`}export{b as getContrastColor,f as getContrastRatio,h as getDarkenColor,d as getLightenColor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function g(t){if(t){if(t.length===2)return`${t}-${t.toUpperCase()}`}else return navigator.language;return t}function y(t){let n={dd:"\\d{2}",mm:"\\d{2}",yyyy:"\\d{4}"},e=t.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/dd|mm|yyyy/g,r=>n[r]);return new RegExp(`^${e}$`)}function f(t){let n=g(t),r=new Intl.DateTimeFormat(n,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),o=r.map(s=>s.type),a={year:"yyyy",month:"MM",day:"dd"};return o.map((s,c)=>a[s]||r[c].value).join("").toLocaleLowerCase()}function d(t){let n=g(t),e=[],r=new Intl.DateTimeFormat(n,{weekday:"short",timeZone:"UTC"});for(let o=0;o<7;o++){let a=new Date(Date.UTC(2024,0,1+o)),i=r.format(a).replace(/^\w/,s=>s.toUpperCase());e.push(i)}return e}function l(t){let n=g(t),e=new Intl.DateTimeFormat(n,{month:"long"});return Array.from({length:12},(r,o)=>{let a=new Date;return a.setMonth(o),e.format(a).replace(/^\w/,i=>i.toUpperCase())})}function p({displayFormat:t,isRange:n,startDate:e,endDate:r,language:o}){let a={year:"numeric",month:"2-digit",day:"2-digit"};if(t)return n&&e&&r?`${m(e,t)} - ${m(r,t)}`:e?m(e,t):"";let i=g(o);return n&&e&&r?`${new Intl.DateTimeFormat(i,a).format(e)} - ${new Intl.DateTimeFormat(i,a).format(r)}`:e?new Intl.DateTimeFormat(i,a).format(e):""}function m(t,n){let e={yyyy:String(t.getFullYear()),mm:String(t.getMonth()+1).padStart(2,"0"),dd:String(t.getDate()).padStart(2,"0")};return n.replace(/yyyy|mm|dd/gi,r=>e[r.toLowerCase()])}function w(t,n,e){let r=e??f(n);if(!y(r).test(t))return!1;let o=u(t,r);return!Number.isNaN(o.getTime())&&m(o,r)===t}function u(t,n="mm/dd/yyyy"){let e=n.toLowerCase(),r=o=>{let a=e.indexOf(o);return a===-1?Number.NaN:Number(t.slice(a,a+o.length))};return new Date(r("yyyy"),r("mm")-1,r("dd"))}export{m as formatDate,f as getDateFormatByLanguage,u as getDateFromDateString,p as getDateStringByLanguage,d as getDaysOfWeekByLanguage,l as getMonthsByLanguage,w as validateFormatDate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./colors.mjs";export*from"./dates.mjs";export*from"./lazy.mjs";export*from"./merge.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{lazy as t}from"react";function n(e){return t(()=>new Promise(o=>{o({default:()=>e})}))}export{n as lazyLoadContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(t,...s){function r(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function c(n,u){if(!r(n)||!r(u))return u;let f={...n};for(let o of Object.keys(u))f[o]=o in n?c(n[o],u[o]):u[o];return f}let e=r(t)?{...t}:t;for(let n of s)n!==void 0&&(e=c(e,n));return e}export{i as deepMerge};
|
package/package.json
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plume-ui-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A lightweight TypeScript React UI component library, themed with CSS variables.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": "./dist/styles.css",
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"**/*.css"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/**"
|
|
28
|
+
],
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/darioegb/plume-ui-react.git",
|
|
32
|
+
"directory": "packages/plume-ui-react"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://darioegb.github.io/plume-ui-react/",
|
|
35
|
+
"bugs": "https://github.com/darioegb/plume-ui-react/issues",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"react",
|
|
38
|
+
"typescript",
|
|
39
|
+
"components",
|
|
40
|
+
"ui",
|
|
41
|
+
"design-system",
|
|
42
|
+
"react-components",
|
|
43
|
+
"uikit",
|
|
44
|
+
"accessible",
|
|
45
|
+
"css-variables",
|
|
46
|
+
"ssr",
|
|
47
|
+
"plume-ui",
|
|
48
|
+
"plume-ui-react"
|
|
49
|
+
],
|
|
50
|
+
"author": "Dario E Gonzalez B <darioegb@gmail.com>",
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@testing-library/dom": "^10.4.2",
|
|
53
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
54
|
+
"@testing-library/react": "^16.3.3",
|
|
55
|
+
"@testing-library/user-event": "^14.6.8",
|
|
56
|
+
"@types/react": "^19.3.0",
|
|
57
|
+
"@types/react-dom": "^19.3.0",
|
|
58
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
59
|
+
"eslint-config-custom": "0.0.1",
|
|
60
|
+
"jsdom": "^30.1.3",
|
|
61
|
+
"postcss": "^8.4.29",
|
|
62
|
+
"postcss-modules": "^6.0.0",
|
|
63
|
+
"prettier-config": "0.0.2",
|
|
64
|
+
"react": "^19.3.0",
|
|
65
|
+
"react-dom": "^19.3.0",
|
|
66
|
+
"react-hook-form": "7.89.0",
|
|
67
|
+
"tsconfig": "0.0.1",
|
|
68
|
+
"tsup": "^8.5.1",
|
|
69
|
+
"typescript": "^5.2.2",
|
|
70
|
+
"vitest": "^5.0.5"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"react": ">=18",
|
|
74
|
+
"react-dom": ">=18"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "rm -rf dist && tsup && node scripts/check-client-directives.mjs",
|
|
81
|
+
"dev": "tsup --watch",
|
|
82
|
+
"lint": "eslint src/",
|
|
83
|
+
"lint:fix": "eslint src/ --fix",
|
|
84
|
+
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"test:coverage": "vitest run --coverage",
|
|
87
|
+
"test:watch": "vitest"
|
|
88
|
+
}
|
|
6
89
|
}
|