@sunggang/ui-lib 0.2.16 → 0.2.18

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/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { o as BaseTable, t as BigCalender, B as Button, C as CkEditor, w as CustomSelect, j as CustomUpload, n as DataTable, l as DateRangePicker, u as DnDCalendar, i as DropDown, D as DropImage, L as LiffProvider, R as ReactDateRange, p as Regex, S as Spin, k as Switch, T as TabsPanel, U as UiLibrary, m as buttonVariants, r as decryptByEcPay, s as encryptByEcPay, x as useLiff, q as verifyId, v as verifyTaxId } from './index.esm2.js';
1
+ export { o as BaseTable, t as BigCalender, B as Button, C as CkEditor, w as CustomSelect, j as CustomUpload, n as DataTable, l as DateRangePicker, u as DnDCalendar, i as DropDown, D as DropImage, L as LiffContext, x as LiffProvider, R as ReactDateRange, p as Regex, S as Spin, k as Switch, T as TabsPanel, U as UiLibrary, m as buttonVariants, r as decryptByEcPay, s as encryptByEcPay, y as useLiff, q as verifyId, v as verifyTaxId } from './index.esm2.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@iconify/react';
package/index.esm2.js CHANGED
@@ -86035,11 +86035,14 @@ function _object_without_properties_loose$6(source, excluded) {
86035
86035
  return target;
86036
86036
  }
86037
86037
  var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
86038
- var className = _param.className, props = _object_without_properties$6(_param, [
86039
- "className"
86038
+ var className = _param.className, color = _param.color, props = _object_without_properties$6(_param, [
86039
+ "className",
86040
+ "color"
86040
86041
  ]);
86042
+ // 設置預設顏色或自定義顏色
86043
+ var bgColor = color === "blue" ? "data-[state=checked]:bg-blue-500" : color === "red" ? "data-[state=checked]:bg-red-500" : color === "green" ? "data-[state=checked]:bg-green-500" : color === "yellow" ? "data-[state=checked]:bg-yellow-500" : "";
86041
86044
  return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$4(_object_spread$7({
86042
- className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)
86045
+ className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", bgColor, "data-[state=unchecked]:bg-input", className)
86043
86046
  }, props), {
86044
86047
  ref: ref,
86045
86048
  children: /*#__PURE__*/ jsx(SwitchPrimitives.Thumb, {
@@ -86047,7 +86050,6 @@ var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
86047
86050
  })
86048
86051
  }));
86049
86052
  });
86050
- Switch.displayName = SwitchPrimitives.Root.displayName;
86051
86053
 
86052
86054
  function _define_property$6(obj, key, value) {
86053
86055
  if (key in obj) {
@@ -110314,7 +110316,7 @@ function _ts_generator(thisArg, body) {
110314
110316
  }
110315
110317
  var LiffContext = /*#__PURE__*/ createContext(undefined);
110316
110318
  var LiffProvider = function(param) {
110317
- var children = param.children, liffId = param.liffId, _param_localStorageKey = param.localStorageKey, localStorageKey = _param_localStorageKey === void 0 ? "one-gobo-global-token" : _param_localStorageKey, _param_loginDataKey = param.loginDataKey, loginDataKey = _param_loginDataKey === void 0 ? "one-gobo-login-data" : _param_loginDataKey, _param_checkTokenUrl = param.checkTokenUrl, checkTokenUrl = _param_checkTokenUrl === void 0 ? "".concat(process.env.NEXT_PUBLIC_CRM_API, "/crm/auth/test_token") : _param_checkTokenUrl, _param_loginUrl = param.loginUrl, loginUrl = _param_loginUrl === void 0 ? "".concat(process.env.NEXT_PUBLIC_CRM_API, "/crm/auth/login") : _param_loginUrl;
110319
+ var children = param.children, liffId = param.liffId, _param_localStorageKey = param.localStorageKey, localStorageKey = _param_localStorageKey === void 0 ? "one-gobo-global-token" : _param_localStorageKey, _param_loginDataKey = param.loginDataKey, loginDataKey = _param_loginDataKey === void 0 ? "one-gobo-login-data" : _param_loginDataKey, checkTokenUrl = param.checkTokenUrl, loginUrl = param.loginUrl;
110318
110320
  var _useState = _sliced_to_array(useState(null), 2), liffObject = _useState[0], setLiffObject = _useState[1];
110319
110321
  var _useState1 = _sliced_to_array(useState(""), 2), accessToken = _useState1[0], setAccessToken = _useState1[1];
110320
110322
  var _useState2 = _sliced_to_array(useState(null), 2), error = _useState2[0], setError = _useState2[1];
@@ -110595,4 +110597,4 @@ var useLiff = function() {
110595
110597
  return context;
110596
110598
  };
110597
110599
 
110598
- export { Button as B, CkEditor as C, DropImage as D, LiffProvider as L, ReactDateRange as R, Spin as S, TabsPanel as T, UiLibrary as U, __spreadArray as _, __read as a, __extends as b, __assign as c, __makeTemplateObject as d, __awaiter as e, __generator as f, commonjsGlobal as g, __values as h, DropDown as i, CustomUpload as j, Switch as k, DateRangePicker as l, buttonVariants as m, DataTable as n, BaseTable as o, Regex as p, verifyId as q, decryptByEcPay as r, encryptByEcPay as s, BigCalender as t, DnDCalendar as u, verifyTaxId as v, CustomSelect as w, useLiff as x };
110600
+ export { Button as B, CkEditor as C, DropImage as D, LiffContext as L, ReactDateRange as R, Spin as S, TabsPanel as T, UiLibrary as U, __spreadArray as _, __read as a, __extends as b, __assign as c, __makeTemplateObject as d, __awaiter as e, __generator as f, commonjsGlobal as g, __values as h, DropDown as i, CustomUpload as j, Switch as k, DateRangePicker as l, buttonVariants as m, DataTable as n, BaseTable as o, Regex as p, verifyId as q, decryptByEcPay as r, encryptByEcPay as s, BigCalender as t, DnDCalendar as u, verifyTaxId as v, CustomSelect as w, LiffProvider as x, useLiff as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "dependencies": {
5
5
  "@iconify/react": "^4.1.1",
6
6
  "@mdx-js/react": "^3.0.1",
package/src/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export * from './lib/Spin';
6
6
  export * from './lib/DropImage';
7
7
  export * from './lib/Dropdown';
8
8
  export * from './lib/UploadImage/CustomUpload';
9
- export * from './lib/Switch';
9
+ export * from './components/ui/switch';
10
10
  export * from './components/ui/dateRangePicker';
11
11
  export * from './components/ui/reactDateRange';
12
12
  export * from './components/ui/button';
@@ -6,13 +6,14 @@ type LiffContextType = {
6
6
  error: string | null;
7
7
  initializeLiff: () => Promise<void>;
8
8
  };
9
+ export declare const LiffContext: React.Context<LiffContextType | undefined>;
9
10
  export declare const LiffProvider: ({ children, liffId, localStorageKey, loginDataKey, checkTokenUrl, loginUrl, }: {
10
11
  children: React.ReactNode;
11
12
  liffId: string;
12
13
  localStorageKey: string;
13
14
  loginDataKey: string;
14
- checkTokenUrl?: string | undefined;
15
- loginUrl?: string | undefined;
15
+ checkTokenUrl: string;
16
+ loginUrl: string;
16
17
  }) => import("react/jsx-runtime").JSX.Element;
17
18
  export declare const useLiff: () => LiffContextType;
18
19
  export {};
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import * as SwitchPrimitives from '@radix-ui/react-switch';
3
- export declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
- export default Switch;