@sunggang/ui-lib 0.2.16 → 0.2.17
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.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
|
|
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,
|
|
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];
|
package/package.json
CHANGED
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 './
|
|
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';
|
|
@@ -11,8 +11,8 @@ export declare const LiffProvider: ({ children, liffId, localStorageKey, loginDa
|
|
|
11
11
|
liffId: string;
|
|
12
12
|
localStorageKey: string;
|
|
13
13
|
loginDataKey: string;
|
|
14
|
-
checkTokenUrl
|
|
15
|
-
loginUrl
|
|
14
|
+
checkTokenUrl: string;
|
|
15
|
+
loginUrl: string;
|
|
16
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export declare const useLiff: () => LiffContextType;
|
|
18
18
|
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;
|