@shoplflow/base 0.42.15 → 0.42.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/dist/index.cjs CHANGED
@@ -2164,7 +2164,7 @@ var MinusButton = React3.forwardRef((_a, ref) => {
2164
2164
  });
2165
2165
  MinusButton[MUNUS_BUTTON_SYMBOL_KEY] = true;
2166
2166
  exports.MinusButton = MinusButton;
2167
- var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2167
+ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered, readOnly) => {
2168
2168
  const domain = exports.getDomain();
2169
2169
  const primaryColor = domain === "hada" ? exports.colorTokens.neutral700 : exports.colorTokens.primary300;
2170
2170
  const primaryHoverColor = domain === "hada" ? exports.colorTokens.neutral700 : exports.colorTokens.primary400;
@@ -2177,7 +2177,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2177
2177
  & > svg > path {
2178
2178
  fill: ${exports.colorTokens.neutral0};
2179
2179
  }
2180
- ${isHovered && react$1.css`
2180
+ ${isHovered && !readOnly && react$1.css`
2181
2181
  border: 1.5px solid ${primaryHoverColor};
2182
2182
  background: ${primaryHoverColor};
2183
2183
  `}
@@ -2187,7 +2187,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2187
2187
  background: ${exports.colorTokens.neutral200};
2188
2188
  border: 1.5px solid ${exports.colorTokens.neutral200};
2189
2189
  border-radius: 4px;
2190
- ${isHovered && react$1.css`
2190
+ ${isHovered && !readOnly && react$1.css`
2191
2191
  border: 1.5px solid ${exports.colorTokens.neutral300};
2192
2192
  background: ${exports.colorTokens.neutral300};
2193
2193
  `}
@@ -2205,7 +2205,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2205
2205
  & > svg > path {
2206
2206
  fill: ${exports.colorTokens.primary300};
2207
2207
  }
2208
- ${isHovered && react$1.css`
2208
+ ${isHovered && !readOnly && react$1.css`
2209
2209
  border: 1.5px solid ${exports.colorTokens.primary400};
2210
2210
  & > svg > path {
2211
2211
  fill: ${exports.colorTokens.primary400};
@@ -2220,7 +2220,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2220
2220
  & > svg > path {
2221
2221
  fill: ${exports.colorTokens.neutral200};
2222
2222
  }
2223
- ${isHovered && react$1.css`
2223
+ ${isHovered && !readOnly && react$1.css`
2224
2224
  border: 1.5px solid ${exports.colorTokens.neutral300};
2225
2225
  & > svg > path {
2226
2226
  fill: ${exports.colorTokens.neutral300};
@@ -2249,8 +2249,8 @@ var StyledCheckbox = styled6__default.default.label`
2249
2249
  background: ${exports.colorTokens.neutral200};
2250
2250
  border-radius: 4px;
2251
2251
  box-sizing: border-box;
2252
- cursor: pointer;
2253
- ${({ styleVar, isSelected, isHovered }) => getStylesByStyleVariant(styleVar, isSelected, isHovered)};
2252
+ cursor: ${({ readOnly }) => readOnly ? "default" : "pointer"};
2253
+ ${({ styleVar, isSelected, isHovered, readOnly }) => getStylesByStyleVariant(styleVar, isSelected, isHovered, readOnly)};
2254
2254
  ${({ disabled }) => getDisabledStyle(disabled)}
2255
2255
  `;
2256
2256
  var Container3 = styled6__default.default.button`
@@ -2265,7 +2265,27 @@ var Container3 = styled6__default.default.button`
2265
2265
  exports.CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
2266
2266
  var Checkbox = React3.forwardRef(
2267
2267
  (_a, ref) => {
2268
- var _b = _a, { defaultSelected, isSelected, disabled, onMouseEnter, onClick, onMouseLeave, styleVar = "PRIMARY", id } = _b, rest = __objRest(_b, ["defaultSelected", "isSelected", "disabled", "onMouseEnter", "onClick", "onMouseLeave", "styleVar", "id"]);
2268
+ var _b = _a, {
2269
+ defaultSelected,
2270
+ isSelected,
2271
+ disabled,
2272
+ onMouseEnter,
2273
+ onClick,
2274
+ onMouseLeave,
2275
+ readOnly,
2276
+ styleVar = "PRIMARY",
2277
+ id
2278
+ } = _b, rest = __objRest(_b, [
2279
+ "defaultSelected",
2280
+ "isSelected",
2281
+ "disabled",
2282
+ "onMouseEnter",
2283
+ "onClick",
2284
+ "onMouseLeave",
2285
+ "readOnly",
2286
+ "styleVar",
2287
+ "id"
2288
+ ]);
2269
2289
  const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
2270
2290
  const [isHovered, toggleHovered] = React3.useState(false);
2271
2291
  const handleMouseLeave = (e) => {
@@ -2293,7 +2313,7 @@ var Checkbox = React3.forwardRef(
2293
2313
  type: "button",
2294
2314
  "data-shoplflow": "Checkbox",
2295
2315
  children: [
2296
- /* @__PURE__ */ jsxRuntime.jsx(StyledCheckHiddenInput, __spreadProps(__spreadValues({ type: "checkbox", disabled, id }, rest), { ref })),
2316
+ /* @__PURE__ */ jsxRuntime.jsx(StyledCheckHiddenInput, __spreadProps(__spreadValues({ type: "checkbox", disabled, id, readOnly }, rest), { ref })),
2297
2317
  /* @__PURE__ */ jsxRuntime.jsx(
2298
2318
  StyledCheckbox,
2299
2319
  {
@@ -2301,6 +2321,7 @@ var Checkbox = React3.forwardRef(
2301
2321
  htmlFor: id,
2302
2322
  isHovered,
2303
2323
  isSelected: selected,
2324
+ readOnly,
2304
2325
  disabled,
2305
2326
  children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
2306
2327
  "path",
@@ -4510,7 +4531,7 @@ var StyledTab = styled6__default.default.div`
4510
4531
  flex-direction: row;
4511
4532
  align-items: center;
4512
4533
  width: fit-content;
4513
- cursor: pointer;
4534
+ cursor: ${({ clickable }) => clickable ? "pointer" : "default"};
4514
4535
  position: relative;
4515
4536
  gap: 4px;
4516
4537
  user-select: none;
@@ -4575,7 +4596,7 @@ var getActiveTextStyleByStyleVar = (styleVar, activeColor) => {
4575
4596
  }
4576
4597
  };
4577
4598
  var StyledTabText = styled6__default.default(exports.Text)`
4578
- cursor: pointer;
4599
+ cursor: ${({ clickable }) => clickable ? "pointer" : "default"};
4579
4600
 
4580
4601
  ${({ styleVar }) => styleVar && getTextStyleByStyleVar(styleVar)};
4581
4602
 
@@ -4594,6 +4615,7 @@ var Tab = (_a) => {
4594
4615
  as,
4595
4616
  styleVar = "NORMAL",
4596
4617
  sizeVar = "L",
4618
+ clickable = true,
4597
4619
  onClick,
4598
4620
  activeColor
4599
4621
  } = _b, args = __objRest(_b, [
@@ -4604,6 +4626,7 @@ var Tab = (_a) => {
4604
4626
  "as",
4605
4627
  "styleVar",
4606
4628
  "sizeVar",
4629
+ "clickable",
4607
4630
  "onClick",
4608
4631
  "activeColor"
4609
4632
  ]);
@@ -4617,8 +4640,10 @@ var Tab = (_a) => {
4617
4640
  setIsHover(false);
4618
4641
  }, []);
4619
4642
  const clickHandler = (event) => {
4620
- onClick == null ? void 0 : onClick(event);
4621
- setActiveTab(value);
4643
+ if (clickable) {
4644
+ onClick == null ? void 0 : onClick(event);
4645
+ setActiveTab(value);
4646
+ }
4622
4647
  };
4623
4648
  let typography = "title1_700";
4624
4649
  if (styleVar === "INFO") {
@@ -4633,10 +4658,10 @@ var Tab = (_a) => {
4633
4658
  isActive,
4634
4659
  as,
4635
4660
  onClick: clickHandler,
4636
- onMouseOver: hoverHandler,
4637
- onMouseLeave: unhoverHandler,
4638
- onFocus: hoverHandler,
4639
- onBlur: unhoverHandler,
4661
+ onMouseOver: clickable ? hoverHandler : void 0,
4662
+ onMouseLeave: clickable ? unhoverHandler : void 0,
4663
+ onFocus: clickable ? hoverHandler : void 0,
4664
+ onBlur: clickable ? unhoverHandler : void 0,
4640
4665
  isHover,
4641
4666
  styleVar
4642
4667
  }, args), {
@@ -4651,6 +4676,7 @@ var Tab = (_a) => {
4651
4676
  isActive,
4652
4677
  activeColor,
4653
4678
  styleVar,
4679
+ clickable,
4654
4680
  children: label
4655
4681
  }
4656
4682
  ),
package/dist/index.d.cts CHANGED
@@ -1294,11 +1294,13 @@ interface TabProps extends TabOptionProps {
1294
1294
  interface TabOptionProps extends LeftAndRightNodeProps, StyleVariantProps<TabStyleVariantType>, SizeVariantProps<TabSizeVariantType>, Omit<HTMLAttributes<HTMLElement>, 'color'> {
1295
1295
  as?: React.ElementType;
1296
1296
  activeColor?: ColorTokens;
1297
+ clickable?: boolean;
1297
1298
  }
1298
1299
  interface TabStyledProps extends StyleVariantProps<TabStyleVariantType> {
1299
1300
  as?: React.ElementType;
1300
1301
  isActive: boolean;
1301
1302
  isHover: boolean;
1303
+ clickable?: boolean;
1302
1304
  }
1303
1305
  interface TabTextStyledProps extends TabStyledProps {
1304
1306
  activeColor?: ColorTokens;
@@ -1306,7 +1308,7 @@ interface TabTextStyledProps extends TabStyledProps {
1306
1308
 
1307
1309
  declare const Tabs: {
1308
1310
  ({ children, initialTab, onChange }: TabsProps): react_jsx_runtime.JSX.Element;
1309
- Tab: ({ value, label, leftSource, rightSource, as, styleVar, sizeVar, onClick, activeColor, ...args }: TabProps) => react_jsx_runtime.JSX.Element;
1311
+ Tab: ({ value, label, leftSource, rightSource, as, styleVar, sizeVar, clickable, onClick, activeColor, ...args }: TabProps) => react_jsx_runtime.JSX.Element;
1310
1312
  };
1311
1313
 
1312
1314
  declare type TabsContextType = {
package/dist/index.d.ts CHANGED
@@ -1294,11 +1294,13 @@ interface TabProps extends TabOptionProps {
1294
1294
  interface TabOptionProps extends LeftAndRightNodeProps, StyleVariantProps<TabStyleVariantType>, SizeVariantProps<TabSizeVariantType>, Omit<HTMLAttributes<HTMLElement>, 'color'> {
1295
1295
  as?: React.ElementType;
1296
1296
  activeColor?: ColorTokens;
1297
+ clickable?: boolean;
1297
1298
  }
1298
1299
  interface TabStyledProps extends StyleVariantProps<TabStyleVariantType> {
1299
1300
  as?: React.ElementType;
1300
1301
  isActive: boolean;
1301
1302
  isHover: boolean;
1303
+ clickable?: boolean;
1302
1304
  }
1303
1305
  interface TabTextStyledProps extends TabStyledProps {
1304
1306
  activeColor?: ColorTokens;
@@ -1306,7 +1308,7 @@ interface TabTextStyledProps extends TabStyledProps {
1306
1308
 
1307
1309
  declare const Tabs: {
1308
1310
  ({ children, initialTab, onChange }: TabsProps): react_jsx_runtime.JSX.Element;
1309
- Tab: ({ value, label, leftSource, rightSource, as, styleVar, sizeVar, onClick, activeColor, ...args }: TabProps) => react_jsx_runtime.JSX.Element;
1311
+ Tab: ({ value, label, leftSource, rightSource, as, styleVar, sizeVar, clickable, onClick, activeColor, ...args }: TabProps) => react_jsx_runtime.JSX.Element;
1310
1312
  };
1311
1313
 
1312
1314
  declare type TabsContextType = {
package/dist/index.js CHANGED
@@ -2137,7 +2137,7 @@ var MinusButton = forwardRef((_a, ref) => {
2137
2137
  });
2138
2138
  MinusButton[MUNUS_BUTTON_SYMBOL_KEY] = true;
2139
2139
  var MinusButton_default = MinusButton;
2140
- var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2140
+ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered, readOnly) => {
2141
2141
  const domain = getDomain();
2142
2142
  const primaryColor = domain === "hada" ? colorTokens.neutral700 : colorTokens.primary300;
2143
2143
  const primaryHoverColor = domain === "hada" ? colorTokens.neutral700 : colorTokens.primary400;
@@ -2150,7 +2150,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2150
2150
  & > svg > path {
2151
2151
  fill: ${colorTokens.neutral0};
2152
2152
  }
2153
- ${isHovered && css`
2153
+ ${isHovered && !readOnly && css`
2154
2154
  border: 1.5px solid ${primaryHoverColor};
2155
2155
  background: ${primaryHoverColor};
2156
2156
  `}
@@ -2160,7 +2160,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2160
2160
  background: ${colorTokens.neutral200};
2161
2161
  border: 1.5px solid ${colorTokens.neutral200};
2162
2162
  border-radius: 4px;
2163
- ${isHovered && css`
2163
+ ${isHovered && !readOnly && css`
2164
2164
  border: 1.5px solid ${colorTokens.neutral300};
2165
2165
  background: ${colorTokens.neutral300};
2166
2166
  `}
@@ -2178,7 +2178,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2178
2178
  & > svg > path {
2179
2179
  fill: ${colorTokens.primary300};
2180
2180
  }
2181
- ${isHovered && css`
2181
+ ${isHovered && !readOnly && css`
2182
2182
  border: 1.5px solid ${colorTokens.primary400};
2183
2183
  & > svg > path {
2184
2184
  fill: ${colorTokens.primary400};
@@ -2193,7 +2193,7 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
2193
2193
  & > svg > path {
2194
2194
  fill: ${colorTokens.neutral200};
2195
2195
  }
2196
- ${isHovered && css`
2196
+ ${isHovered && !readOnly && css`
2197
2197
  border: 1.5px solid ${colorTokens.neutral300};
2198
2198
  & > svg > path {
2199
2199
  fill: ${colorTokens.neutral300};
@@ -2222,8 +2222,8 @@ var StyledCheckbox = styled6.label`
2222
2222
  background: ${colorTokens.neutral200};
2223
2223
  border-radius: 4px;
2224
2224
  box-sizing: border-box;
2225
- cursor: pointer;
2226
- ${({ styleVar, isSelected, isHovered }) => getStylesByStyleVariant(styleVar, isSelected, isHovered)};
2225
+ cursor: ${({ readOnly }) => readOnly ? "default" : "pointer"};
2226
+ ${({ styleVar, isSelected, isHovered, readOnly }) => getStylesByStyleVariant(styleVar, isSelected, isHovered, readOnly)};
2227
2227
  ${({ disabled }) => getDisabledStyle(disabled)}
2228
2228
  `;
2229
2229
  var Container3 = styled6.button`
@@ -2238,7 +2238,27 @@ var Container3 = styled6.button`
2238
2238
  var CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
2239
2239
  var Checkbox = forwardRef(
2240
2240
  (_a, ref) => {
2241
- var _b = _a, { defaultSelected, isSelected, disabled, onMouseEnter, onClick, onMouseLeave, styleVar = "PRIMARY", id } = _b, rest = __objRest(_b, ["defaultSelected", "isSelected", "disabled", "onMouseEnter", "onClick", "onMouseLeave", "styleVar", "id"]);
2241
+ var _b = _a, {
2242
+ defaultSelected,
2243
+ isSelected,
2244
+ disabled,
2245
+ onMouseEnter,
2246
+ onClick,
2247
+ onMouseLeave,
2248
+ readOnly,
2249
+ styleVar = "PRIMARY",
2250
+ id
2251
+ } = _b, rest = __objRest(_b, [
2252
+ "defaultSelected",
2253
+ "isSelected",
2254
+ "disabled",
2255
+ "onMouseEnter",
2256
+ "onClick",
2257
+ "onMouseLeave",
2258
+ "readOnly",
2259
+ "styleVar",
2260
+ "id"
2261
+ ]);
2242
2262
  const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
2243
2263
  const [isHovered, toggleHovered] = useState(false);
2244
2264
  const handleMouseLeave = (e) => {
@@ -2266,7 +2286,7 @@ var Checkbox = forwardRef(
2266
2286
  type: "button",
2267
2287
  "data-shoplflow": "Checkbox",
2268
2288
  children: [
2269
- /* @__PURE__ */ jsx(StyledCheckHiddenInput, __spreadProps(__spreadValues({ type: "checkbox", disabled, id }, rest), { ref })),
2289
+ /* @__PURE__ */ jsx(StyledCheckHiddenInput, __spreadProps(__spreadValues({ type: "checkbox", disabled, id, readOnly }, rest), { ref })),
2270
2290
  /* @__PURE__ */ jsx(
2271
2291
  StyledCheckbox,
2272
2292
  {
@@ -2274,6 +2294,7 @@ var Checkbox = forwardRef(
2274
2294
  htmlFor: id,
2275
2295
  isHovered,
2276
2296
  isSelected: selected,
2297
+ readOnly,
2277
2298
  disabled,
2278
2299
  children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", children: /* @__PURE__ */ jsx(
2279
2300
  "path",
@@ -4483,7 +4504,7 @@ var StyledTab = styled6.div`
4483
4504
  flex-direction: row;
4484
4505
  align-items: center;
4485
4506
  width: fit-content;
4486
- cursor: pointer;
4507
+ cursor: ${({ clickable }) => clickable ? "pointer" : "default"};
4487
4508
  position: relative;
4488
4509
  gap: 4px;
4489
4510
  user-select: none;
@@ -4548,7 +4569,7 @@ var getActiveTextStyleByStyleVar = (styleVar, activeColor) => {
4548
4569
  }
4549
4570
  };
4550
4571
  var StyledTabText = styled6(Text_default)`
4551
- cursor: pointer;
4572
+ cursor: ${({ clickable }) => clickable ? "pointer" : "default"};
4552
4573
 
4553
4574
  ${({ styleVar }) => styleVar && getTextStyleByStyleVar(styleVar)};
4554
4575
 
@@ -4567,6 +4588,7 @@ var Tab = (_a) => {
4567
4588
  as,
4568
4589
  styleVar = "NORMAL",
4569
4590
  sizeVar = "L",
4591
+ clickable = true,
4570
4592
  onClick,
4571
4593
  activeColor
4572
4594
  } = _b, args = __objRest(_b, [
@@ -4577,6 +4599,7 @@ var Tab = (_a) => {
4577
4599
  "as",
4578
4600
  "styleVar",
4579
4601
  "sizeVar",
4602
+ "clickable",
4580
4603
  "onClick",
4581
4604
  "activeColor"
4582
4605
  ]);
@@ -4590,8 +4613,10 @@ var Tab = (_a) => {
4590
4613
  setIsHover(false);
4591
4614
  }, []);
4592
4615
  const clickHandler = (event) => {
4593
- onClick == null ? void 0 : onClick(event);
4594
- setActiveTab(value);
4616
+ if (clickable) {
4617
+ onClick == null ? void 0 : onClick(event);
4618
+ setActiveTab(value);
4619
+ }
4595
4620
  };
4596
4621
  let typography = "title1_700";
4597
4622
  if (styleVar === "INFO") {
@@ -4606,10 +4631,10 @@ var Tab = (_a) => {
4606
4631
  isActive,
4607
4632
  as,
4608
4633
  onClick: clickHandler,
4609
- onMouseOver: hoverHandler,
4610
- onMouseLeave: unhoverHandler,
4611
- onFocus: hoverHandler,
4612
- onBlur: unhoverHandler,
4634
+ onMouseOver: clickable ? hoverHandler : void 0,
4635
+ onMouseLeave: clickable ? unhoverHandler : void 0,
4636
+ onFocus: clickable ? hoverHandler : void 0,
4637
+ onBlur: clickable ? unhoverHandler : void 0,
4613
4638
  isHover,
4614
4639
  styleVar
4615
4640
  }, args), {
@@ -4624,6 +4649,7 @@ var Tab = (_a) => {
4624
4649
  isActive,
4625
4650
  activeColor,
4626
4651
  styleVar,
4652
+ clickable,
4627
4653
  children: label
4628
4654
  }
4629
4655
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/base",
3
- "version": "0.42.15",
3
+ "version": "0.42.17",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",