@starasia/text 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/text.es.js +58 -81
- package/dist/text.umd.js +2 -10
- package/package.json +8 -8
package/dist/text.es.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var k = z, W = Symbol.for("react.element"), H = Symbol.for("react.fragment"), O = Object.prototype.hasOwnProperty, T = k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
13
|
-
function d(n, a, o) {
|
|
14
|
-
var i, s = {}, t = null, e = null;
|
|
15
|
-
o !== void 0 && (t = "" + o), a.key !== void 0 && (t = "" + a.key), a.ref !== void 0 && (e = a.ref);
|
|
16
|
-
for (i in a) O.call(a, i) && !R.hasOwnProperty(i) && (s[i] = a[i]);
|
|
17
|
-
if (n && n.defaultProps) for (i in a = n.defaultProps, a) s[i] === void 0 && (s[i] = a[i]);
|
|
18
|
-
return { $$typeof: W, type: n, key: t, ref: e, props: s, _owner: T.current };
|
|
19
|
-
}
|
|
20
|
-
m.Fragment = H;
|
|
21
|
-
m.jsx = d;
|
|
22
|
-
m.jsxs = d;
|
|
23
|
-
x.exports = m;
|
|
24
|
-
var C = x.exports;
|
|
25
|
-
const E = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
const w = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
|
|
26
3
|
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
|
|
27
4
|
|
|
28
5
|
* {
|
|
@@ -1803,68 +1780,68 @@ const E = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital
|
|
|
1803
1780
|
overflow: hidden;
|
|
1804
1781
|
text-overflow: ellipsis;
|
|
1805
1782
|
}
|
|
1806
|
-
`,
|
|
1783
|
+
`, z = (n) => !Number(n) && Number(n) !== 0 ? n : new Intl.NumberFormat("id-ID", {
|
|
1807
1784
|
style: "currency",
|
|
1808
1785
|
currency: "IDR",
|
|
1809
1786
|
minimumFractionDigits: 0
|
|
1810
|
-
}).format(n),
|
|
1811
|
-
const
|
|
1812
|
-
return n &&
|
|
1813
|
-
},
|
|
1814
|
-
if (!document.getElementById(
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1787
|
+
}).format(n), S = (n, i, r, s, u, t, o, e, g, l, c, m) => {
|
|
1788
|
+
const a = [];
|
|
1789
|
+
return n && a.push(`starasia-fontSizes-${n}`), i && a.push(`starasia-fontWeights-${i}`), r && a.push(`starasia-text-align-${r}`), s && a.push(`starasia-text-color-${s}`), u && a.push(`starasia-margin-${u}`), t && a.push(`starasia-margin-top-${t}`), o && a.push(`starasia-margin-right-${o}`), e && a.push(`starasia-margin-bottom-${e}`), g && a.push(`starasia-margin-left-${g}`), l && a.push(`starasia-${l}`), c && a.push(`starasia-text-${c}`), m && a.push("starasia-text-truncate"), a.push(""), a.join(" ");
|
|
1790
|
+
}, v = "starasia-text-styles", k = (n) => {
|
|
1791
|
+
if (!document.getElementById(v)) {
|
|
1792
|
+
const i = document.createElement("style");
|
|
1793
|
+
i.id = v, i.textContent = n, document.head.appendChild(i);
|
|
1817
1794
|
}
|
|
1818
1795
|
};
|
|
1819
|
-
|
|
1820
|
-
const
|
|
1796
|
+
k(w);
|
|
1797
|
+
const T = (n) => {
|
|
1821
1798
|
const {
|
|
1822
|
-
children:
|
|
1823
|
-
fontSize:
|
|
1824
|
-
fontWeight:
|
|
1825
|
-
align:
|
|
1799
|
+
children: i,
|
|
1800
|
+
fontSize: r = "md",
|
|
1801
|
+
fontWeight: s = "normal",
|
|
1802
|
+
align: u = "left",
|
|
1826
1803
|
color: t = "text",
|
|
1827
|
-
margin:
|
|
1828
|
-
marginTop:
|
|
1829
|
-
marginBottom:
|
|
1830
|
-
marginRight:
|
|
1831
|
-
marginLeft:
|
|
1832
|
-
lineHeight:
|
|
1833
|
-
textAlign:
|
|
1834
|
-
fontFamily:
|
|
1835
|
-
letterSpacing:
|
|
1836
|
-
currency:
|
|
1837
|
-
variant:
|
|
1838
|
-
truncate:
|
|
1839
|
-
...
|
|
1804
|
+
margin: o = "spacing-0",
|
|
1805
|
+
marginTop: e,
|
|
1806
|
+
marginBottom: g,
|
|
1807
|
+
marginRight: l,
|
|
1808
|
+
marginLeft: c,
|
|
1809
|
+
lineHeight: m,
|
|
1810
|
+
textAlign: a = "left",
|
|
1811
|
+
fontFamily: f = "Poppins",
|
|
1812
|
+
letterSpacing: x,
|
|
1813
|
+
currency: d,
|
|
1814
|
+
variant: h,
|
|
1815
|
+
truncate: b,
|
|
1816
|
+
...p
|
|
1840
1817
|
} = n;
|
|
1841
|
-
return /* @__PURE__ */
|
|
1818
|
+
return /* @__PURE__ */ y(
|
|
1842
1819
|
"p",
|
|
1843
1820
|
{
|
|
1844
|
-
...
|
|
1845
|
-
className: `${
|
|
1846
|
-
o,
|
|
1847
|
-
i,
|
|
1821
|
+
...p,
|
|
1822
|
+
className: `${S(
|
|
1848
1823
|
r,
|
|
1824
|
+
s,
|
|
1825
|
+
a,
|
|
1849
1826
|
t,
|
|
1827
|
+
o,
|
|
1850
1828
|
e,
|
|
1829
|
+
l,
|
|
1851
1830
|
g,
|
|
1852
1831
|
c,
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
S
|
|
1858
|
-
)} ${v.className}`,
|
|
1832
|
+
m,
|
|
1833
|
+
h,
|
|
1834
|
+
b
|
|
1835
|
+
)} ${p.className}`,
|
|
1859
1836
|
style: {
|
|
1860
|
-
fontFamily: `${
|
|
1861
|
-
letterSpacing:
|
|
1862
|
-
...
|
|
1837
|
+
fontFamily: `${f}, sans-serif`,
|
|
1838
|
+
letterSpacing: x,
|
|
1839
|
+
...p.style
|
|
1863
1840
|
},
|
|
1864
|
-
children:
|
|
1841
|
+
children: d ? z(i) : i
|
|
1865
1842
|
}
|
|
1866
1843
|
);
|
|
1867
|
-
},
|
|
1844
|
+
}, O = [
|
|
1868
1845
|
"leading-3",
|
|
1869
1846
|
"leading-4",
|
|
1870
1847
|
"leading-5",
|
|
@@ -1879,7 +1856,7 @@ const L = (n) => {
|
|
|
1879
1856
|
"leading-normal",
|
|
1880
1857
|
"leading-relaxed",
|
|
1881
1858
|
"leading-loose"
|
|
1882
|
-
],
|
|
1859
|
+
], C = [
|
|
1883
1860
|
"xs",
|
|
1884
1861
|
"sm",
|
|
1885
1862
|
"md",
|
|
@@ -1903,7 +1880,7 @@ const L = (n) => {
|
|
|
1903
1880
|
"spacing-48",
|
|
1904
1881
|
"spacing-56",
|
|
1905
1882
|
"spacing-64"
|
|
1906
|
-
],
|
|
1883
|
+
], N = ["left", "center", "right"], R = [
|
|
1907
1884
|
"hairline",
|
|
1908
1885
|
"thin",
|
|
1909
1886
|
"light",
|
|
@@ -1913,7 +1890,7 @@ const L = (n) => {
|
|
|
1913
1890
|
"bold",
|
|
1914
1891
|
"extrabold",
|
|
1915
1892
|
"black"
|
|
1916
|
-
],
|
|
1893
|
+
], W = [
|
|
1917
1894
|
{
|
|
1918
1895
|
name: "brand",
|
|
1919
1896
|
colors: [
|
|
@@ -2090,9 +2067,9 @@ const L = (n) => {
|
|
|
2090
2067
|
"aloha-900"
|
|
2091
2068
|
]
|
|
2092
2069
|
}
|
|
2093
|
-
],
|
|
2070
|
+
], E = W.map(
|
|
2094
2071
|
(n) => n.colors
|
|
2095
|
-
).flat(),
|
|
2072
|
+
).flat(), I = [
|
|
2096
2073
|
"xs",
|
|
2097
2074
|
"sm",
|
|
2098
2075
|
"md",
|
|
@@ -2105,12 +2082,12 @@ const L = (n) => {
|
|
|
2105
2082
|
"6xl"
|
|
2106
2083
|
];
|
|
2107
2084
|
export {
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2085
|
+
I as FontSizeConst,
|
|
2086
|
+
R as FontWeightConst,
|
|
2087
|
+
O as LineHeightConst,
|
|
2088
|
+
T as Text,
|
|
2089
|
+
N as TextAlignConst,
|
|
2090
|
+
E as TextColorConst,
|
|
2091
|
+
W as TextColorSchemeGenerator,
|
|
2092
|
+
C as TextSpacingConst
|
|
2116
2093
|
};
|
package/dist/text.umd.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var w=l,S=Symbol.for("react.element"),z=Symbol.for("react.fragment"),k=Object.prototype.hasOwnProperty,W=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function h(n,a,e){var s,t={},o=null,g=null;e!==void 0&&(o=""+e),a.key!==void 0&&(o=""+a.key),a.ref!==void 0&&(g=a.ref);for(s in a)k.call(a,s)&&!T.hasOwnProperty(s)&&(t[s]=a[s]);if(n&&n.defaultProps)for(s in a=n.defaultProps,a)t[s]===void 0&&(t[s]=a[s]);return{$$typeof:S,type:n,key:o,ref:g,props:t,_owner:W.current}}c.Fragment=z,c.jsx=h,c.jsxs=h,x.exports=c;var H=x.exports;const C=`@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
|
|
1
|
+
(function(n,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],s):(n=typeof globalThis<"u"?globalThis:n||self,s(n.Text={},n.jsxRuntime))})(this,function(n,s){"use strict";const h=`@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
|
|
10
2
|
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
|
|
11
3
|
|
|
12
4
|
* {
|
|
@@ -1787,4 +1779,4 @@
|
|
|
1787
1779
|
overflow: hidden;
|
|
1788
1780
|
text-overflow: ellipsis;
|
|
1789
1781
|
}
|
|
1790
|
-
`,
|
|
1782
|
+
`,b=i=>!Number(i)&&Number(i)!==0?i:new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",minimumFractionDigits:0}).format(i),y=(i,r,t,o,p,e,g,l,c,u,m,v)=>{const a=[];return i&&a.push(`starasia-fontSizes-${i}`),r&&a.push(`starasia-fontWeights-${r}`),t&&a.push(`starasia-text-align-${t}`),o&&a.push(`starasia-text-color-${o}`),p&&a.push(`starasia-margin-${p}`),e&&a.push(`starasia-margin-top-${e}`),g&&a.push(`starasia-margin-right-${g}`),l&&a.push(`starasia-margin-bottom-${l}`),c&&a.push(`starasia-margin-left-${c}`),u&&a.push(`starasia-${u}`),m&&a.push(`starasia-text-${m}`),v&&a.push("starasia-text-truncate"),a.push(""),a.join(" ")},d="starasia-text-styles";(i=>{if(!document.getElementById(d)){const r=document.createElement("style");r.id=d,r.textContent=i,document.head.appendChild(r)}})(h);const w=i=>{const{children:r,fontSize:t="md",fontWeight:o="normal",align:p="left",color:e="text",margin:g="spacing-0",marginTop:l,marginBottom:c,marginRight:u,marginLeft:m,lineHeight:v,textAlign:a="left",fontFamily:C="Poppins",letterSpacing:O,currency:R,variant:N,truncate:E,...f}=i;return s.jsx("p",{...f,className:`${y(t,o,a,e,g,l,u,c,m,v,N,E)} ${f.className}`,style:{fontFamily:`${C}, sans-serif`,letterSpacing:O,...f.style},children:R?b(r):r})},S=["leading-3","leading-4","leading-5","leading-6","leading-7","leading-8","leading-9","leading-10","leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose"],z=["xs","sm","md","lg","auto","spacing-0","spacing-1","spacing-2","spacing-3","spacing-4","spacing-5","spacing-6","spacing-8","spacing-10","spacing-12","spacing-16","spacing-20","spacing-24","spacing-32","spacing-40","spacing-48","spacing-56","spacing-64"],k=["left","center","right"],W=["hairline","thin","light","normal","medium","semibold","bold","extrabold","black"],x=[{name:"brand",colors:["primary"]},{name:"state",colors:["default","secondary","tertiary","disable","white","success","success-secondary","success-disable","danger","danger-secondary","danger-disable","brand","brand-secondary","info","info-secondary","warning","warning-disable","error"]},{name:"text",colors:["text","text-light","text-muted"]},{name:"gray",colors:["gray-50","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","gray-950"]},{name:"red",colors:["red-50","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-950"]},{name:"orange",colors:["orange-50","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-950"]},{name:"yellow",colors:["yellow-50","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-950"]},{name:"green",colors:["green-50","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-950"]},{name:"blue",colors:["blue-50","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-950"]},{name:"purple",colors:["purple-50","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-950"]},{name:"pink",colors:["pink-50","pink-100","pink-200","pink-300","pink-400","pink-500","pink-600","pink-700","pink-800","pink-900"]},{name:"aloha",colors:["aloha-50","aloha-100","aloha-200","aloha-300","aloha-400","aloha-500","aloha-600","aloha-700","aloha-800","aloha-900"]}],T=x.map(i=>i.colors).flat(),H=["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"];n.FontSizeConst=H,n.FontWeightConst=W,n.LineHeightConst=S,n.Text=w,n.TextAlignConst=k,n.TextColorConst=T,n.TextColorSchemeGenerator=x,n.TextSpacingConst=z,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/text",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "text component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/text.umd.js",
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"dist/*.map",
|
|
13
13
|
"dist/*.css"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "vite --config vite.config.ts --port 3000",
|
|
17
|
-
"build": "cross-env NODE_ENV=production vite build --config vite.config.ts"
|
|
18
|
-
},
|
|
19
15
|
"keywords": [],
|
|
20
16
|
"license": "ISC",
|
|
21
17
|
"type": "module",
|
|
@@ -23,8 +19,8 @@
|
|
|
23
19
|
"node": ">=18.0.0"
|
|
24
20
|
},
|
|
25
21
|
"peerDependencies": {
|
|
26
|
-
"react": ">=18.
|
|
27
|
-
"react-dom": ">=18.
|
|
22
|
+
"react": ">=18.0.0 <20.0.0",
|
|
23
|
+
"react-dom": ">=18.0.0 <20.0.0"
|
|
28
24
|
},
|
|
29
25
|
"devDependencies": {
|
|
30
26
|
"@types/node": "^20.17.52",
|
|
@@ -38,5 +34,9 @@
|
|
|
38
34
|
"typescript": "^5.8.3",
|
|
39
35
|
"vite": "^5.4.19",
|
|
40
36
|
"vite-plugin-dts": "^3.9.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
40
|
+
"build": "cross-env NODE_ENV=production vite build --config vite.config.ts"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|