@starasia/toggle 1.0.2 → 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/toggle.es.js CHANGED
@@ -2,9 +2,9 @@ import { jsxs as e, jsx as n } from "react/jsx-runtime";
2
2
  const g = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
3
3
  :root {
4
4
  /* toogle root color */
5
- --starasia-ui-background-toggle-checked: #1e88e5;
6
- --starasia-ui-background-toggle-checked-hover: #1976d2;
7
- --starasia-ui-shadow-toggle-checked: 0px 0px 0px 1px rgba(100, 181, 246, 0.28);
5
+ --starasia-ui-background-toggle-checked: var(--starasia-ui-brand-primary-default);
6
+ --starasia-ui-background-toggle-checked-hover: rgba(var(--starasia-ui-raw-color-brand-active), 1);
7
+ --starasia-ui-shadow-toggle-checked: 0px 0px 0px 1px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28);
8
8
 
9
9
  --starasia-ui-background-toggle-base: rgba(120, 134, 127, 0.2);
10
10
  --starasia-ui-shadow-toggle-base: 0px 0px 0px 1px rgba(201, 206, 204, 0.28);
@@ -181,15 +181,15 @@ input:checked + .starasia-toggle-slider:before {
181
181
  .starasia-toggle-slider.starasia-toggle-round:before {
182
182
  border-radius: 50%;
183
183
  }
184
- `, r = "starasia-toggle-styles", l = (t) => {
185
- if (!document.getElementById(r)) {
184
+ `, o = "starasia-toggle-styles", l = (t) => {
185
+ if (!document.getElementById(o)) {
186
186
  const a = document.createElement("style");
187
- a.id = r, a.textContent = t, document.head.appendChild(a);
187
+ a.id = o, a.textContent = t, document.head.appendChild(a);
188
188
  }
189
189
  };
190
190
  l(g);
191
191
  const c = (t) => {
192
- const { size: a = "md", label: s, description: i, ...o } = t;
192
+ const { size: a = "md", label: s, description: i, ...r } = t;
193
193
  return /* @__PURE__ */ e(
194
194
  "div",
195
195
  {
@@ -200,7 +200,7 @@ const c = (t) => {
200
200
  {
201
201
  className: `starasia-toggle-switch starasia-toggle-switch-${a}`,
202
202
  children: [
203
- /* @__PURE__ */ n("input", { type: "checkbox", ...o }),
203
+ /* @__PURE__ */ n("input", { type: "checkbox", ...r }),
204
204
  /* @__PURE__ */ n(
205
205
  "span",
206
206
  {
@@ -214,7 +214,7 @@ const c = (t) => {
214
214
  s ? /* @__PURE__ */ n(
215
215
  "label",
216
216
  {
217
- htmlFor: o.id,
217
+ htmlFor: r.id,
218
218
  style: {
219
219
  display: "block"
220
220
  },
@@ -1,9 +1,9 @@
1
1
  (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.Toggle={},n.jsxRuntime))})(this,function(n,a){"use strict";const g=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
2
2
  :root {
3
3
  /* toogle root color */
4
- --starasia-ui-background-toggle-checked: #1e88e5;
5
- --starasia-ui-background-toggle-checked-hover: #1976d2;
6
- --starasia-ui-shadow-toggle-checked: 0px 0px 0px 1px rgba(100, 181, 246, 0.28);
4
+ --starasia-ui-background-toggle-checked: var(--starasia-ui-brand-primary-default);
5
+ --starasia-ui-background-toggle-checked-hover: rgba(var(--starasia-ui-raw-color-brand-active), 1);
6
+ --starasia-ui-shadow-toggle-checked: 0px 0px 0px 1px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28);
7
7
 
8
8
  --starasia-ui-background-toggle-base: rgba(120, 134, 127, 0.2);
9
9
  --starasia-ui-shadow-toggle-base: 0px 0px 0px 1px rgba(201, 206, 204, 0.28);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starasia/toggle",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "toggle component for starasia UI",
5
5
  "author": "Prawito Hudoro",
6
6
  "main": "dist/toggle.umd.js",
@@ -12,6 +12,10 @@
12
12
  "dist/*.map",
13
13
  "dist/*.css"
14
14
  ],
15
+ "scripts": {
16
+ "dev": "vite --config vite.config.ts --port 3000",
17
+ "build": "vite build --config vite.config.ts"
18
+ },
15
19
  "keywords": [],
16
20
  "license": "ISC",
17
21
  "type": "module",
@@ -33,9 +37,5 @@
33
37
  "react-dom": "^18.2.0",
34
38
  "@types/react": "^18.2.55",
35
39
  "@types/react-dom": "^18.2.19"
36
- },
37
- "scripts": {
38
- "dev": "vite --config vite.config.ts --port 3000",
39
- "build": "vite build --config vite.config.ts"
40
40
  }
41
- }
41
+ }