@starasia/text 1.0.1 → 1.0.3

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 CHANGED
@@ -1,28 +1,5 @@
1
- import z from "react";
2
- var x = { exports: {} }, m = {};
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
  * {
@@ -155,9 +132,9 @@ const E = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital
155
132
  /* COLOR BRAND */
156
133
 
157
134
  /* primary */
158
- --starasia-ui-brand-primary-default: var(--starasia-ui-color-blue-700);
159
- --starasia-ui-brand-primary-secondary: var(--starasia-ui-color-blue-300);
160
- --starasia-ui-brand-primary-tertiary: var(--starasia-ui-color-blue-50);
135
+ --starasia-ui-brand-primary-default: rgba(74, 106, 148, 1);
136
+ --starasia-ui-brand-primary-secondary: rgba(144, 176, 218, 1);
137
+ --starasia-ui-brand-primary-tertiary: rgba(227, 237, 248, 1);
161
138
 
162
139
  /* secondary */
163
140
  --starasia-ui-brand-secondary-default: var(--starasia-ui-color-pink-700);
@@ -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
- `, N = (n) => !Number(n) && Number(n) !== 0 ? n : new Intl.NumberFormat("id-ID", {
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), _ = (n, a, o, i, s, t, e, g, l, c, u, p) => {
1811
- const r = [];
1812
- return n && r.push(`starasia-fontSizes-${n}`), a && r.push(`starasia-fontWeights-${a}`), o && r.push(`starasia-text-align-${o}`), i && r.push(`starasia-text-color-${i}`), s && r.push(`starasia-margin-${s}`), t && r.push(`starasia-margin-top-${t}`), e && r.push(`starasia-margin-right-${e}`), g && r.push(`starasia-margin-bottom-${g}`), l && r.push(`starasia-margin-left-${l}`), c && r.push(`starasia-${c}`), u && r.push(`starasia-text-${u}`), p && r.push("starasia-text-truncate"), r.push(""), r.join(" ");
1813
- }, f = "starasia-text-styles", $ = (n) => {
1814
- if (!document.getElementById(f)) {
1815
- const a = document.createElement("style");
1816
- a.id = f, a.textContent = n, document.head.appendChild(a);
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
- $(E);
1820
- const L = (n) => {
1796
+ k(w);
1797
+ const T = (n) => {
1821
1798
  const {
1822
- children: a,
1823
- fontSize: o = "md",
1824
- fontWeight: i = "normal",
1825
- align: s = "left",
1799
+ children: i,
1800
+ fontSize: r = "md",
1801
+ fontWeight: s = "normal",
1802
+ align: u = "left",
1826
1803
  color: t = "text",
1827
- margin: e = "spacing-0",
1828
- marginTop: g,
1829
- marginBottom: l,
1830
- marginRight: c,
1831
- marginLeft: u,
1832
- lineHeight: p,
1833
- textAlign: r = "left",
1834
- fontFamily: h = "Poppins",
1835
- letterSpacing: b,
1836
- currency: y,
1837
- variant: w,
1838
- truncate: S,
1839
- ...v
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__ */ C.jsx(
1818
+ return /* @__PURE__ */ y(
1842
1819
  "p",
1843
1820
  {
1844
- ...v,
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
- l,
1854
- u,
1855
- p,
1856
- w,
1857
- S
1858
- )} ${v.className}`,
1832
+ m,
1833
+ h,
1834
+ b
1835
+ )} ${p.className}`,
1859
1836
  style: {
1860
- fontFamily: `${h}, sans-serif`,
1861
- letterSpacing: b,
1862
- ...v.style
1837
+ fontFamily: `${f}, sans-serif`,
1838
+ letterSpacing: x,
1839
+ ...p.style
1863
1840
  },
1864
- children: y ? N(a) : a
1841
+ children: d ? z(i) : i
1865
1842
  }
1866
1843
  );
1867
- }, F = [
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
- ], A = [
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
- ], j = ["left", "center", "right"], M = [
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
- ], I = [
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
- ], G = I.map(
2070
+ ], E = W.map(
2094
2071
  (n) => n.colors
2095
- ).flat(), P = [
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
- P as FontSizeConst,
2109
- M as FontWeightConst,
2110
- F as LineHeightConst,
2111
- L as Text,
2112
- j as TextAlignConst,
2113
- G as TextColorConst,
2114
- I as TextColorSchemeGenerator,
2115
- A as TextSpacingConst
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(r,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(r=typeof globalThis<"u"?globalThis:r||self,l(r.Text={},r.React))})(this,function(r,l){"use strict";var x={exports:{}},c={};/**
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
  * {
@@ -139,9 +131,9 @@
139
131
  /* COLOR BRAND */
140
132
 
141
133
  /* primary */
142
- --starasia-ui-brand-primary-default: var(--starasia-ui-color-blue-700);
143
- --starasia-ui-brand-primary-secondary: var(--starasia-ui-color-blue-300);
144
- --starasia-ui-brand-primary-tertiary: var(--starasia-ui-color-blue-50);
134
+ --starasia-ui-brand-primary-default: rgba(74, 106, 148, 1);
135
+ --starasia-ui-brand-primary-secondary: rgba(144, 176, 218, 1);
136
+ --starasia-ui-brand-primary-tertiary: rgba(227, 237, 248, 1);
145
137
 
146
138
  /* secondary */
147
139
  --starasia-ui-brand-secondary-default: var(--starasia-ui-color-pink-700);
@@ -1787,4 +1779,4 @@
1787
1779
  overflow: hidden;
1788
1780
  text-overflow: ellipsis;
1789
1781
  }
1790
- `,O=n=>!Number(n)&&Number(n)!==0?n:new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",minimumFractionDigits:0}).format(n),R=(n,a,e,s,t,o,g,u,m,p,v,f)=>{const i=[];return n&&i.push(`starasia-fontSizes-${n}`),a&&i.push(`starasia-fontWeights-${a}`),e&&i.push(`starasia-text-align-${e}`),s&&i.push(`starasia-text-color-${s}`),t&&i.push(`starasia-margin-${t}`),o&&i.push(`starasia-margin-top-${o}`),g&&i.push(`starasia-margin-right-${g}`),u&&i.push(`starasia-margin-bottom-${u}`),m&&i.push(`starasia-margin-left-${m}`),p&&i.push(`starasia-${p}`),v&&i.push(`starasia-text-${v}`),f&&i.push("starasia-text-truncate"),i.push(""),i.join(" ")},b="starasia-text-styles";(n=>{if(!document.getElementById(b)){const a=document.createElement("style");a.id=b,a.textContent=n,document.head.appendChild(a)}})(C);const E=n=>{const{children:a,fontSize:e="md",fontWeight:s="normal",align:t="left",color:o="text",margin:g="spacing-0",marginTop:u,marginBottom:m,marginRight:p,marginLeft:v,lineHeight:f,textAlign:i="left",fontFamily:L="Poppins",letterSpacing:j,currency:A,variant:M,truncate:G,...d}=n;return H.jsx("p",{...d,className:`${R(e,s,i,o,g,u,p,m,v,f,M,G)} ${d.className}`,style:{fontFamily:`${L}, sans-serif`,letterSpacing:j,...d.style},children:A?O(a):a})},N=["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"],_=["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"],I=["left","center","right"],$=["hairline","thin","light","normal","medium","semibold","bold","extrabold","black"],y=[{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"]}],D=y.map(n=>n.colors).flat(),F=["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"];r.FontSizeConst=F,r.FontWeightConst=$,r.LineHeightConst=N,r.Text=E,r.TextAlignConst=I,r.TextColorConst=D,r.TextColorSchemeGenerator=y,r.TextSpacingConst=_,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
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.1",
3
+ "version": "1.0.3",
4
4
  "description": "text component for starasia UI",
5
5
  "author": "Prawito Hudoro",
6
6
  "main": "dist/text.umd.js",