@shoplflow/base 0.41.5 → 0.41.7

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
@@ -4598,17 +4598,29 @@ var PaginationWrapper = styled6__default.default.div`
4598
4598
  align-items: center;
4599
4599
  width: 100%;
4600
4600
  justify-content: space-between;
4601
+
4602
+ &.hada-responsive {
4603
+ @media (max-width: 720px) {
4604
+ justify-content: space-between;
4605
+ }
4606
+ }
4601
4607
  `;
4602
4608
  var StyledPagination = styled6__default.default.nav`
4603
4609
  display: flex;
4604
4610
  align-items: center;
4611
+
4612
+ &.hada-responsive {
4613
+ @media (max-width: 720px) {
4614
+ margin-left: auto;
4615
+ }
4616
+ }
4605
4617
  `;
4606
4618
  var PageItem = styled6__default.default.button`
4607
4619
  display: flex;
4608
4620
  justify-content: center;
4609
4621
  align-items: center;
4610
- width: 32px;
4611
- height: 32px;
4622
+ width: ${({ sizeVar }) => sizeVar === "XS" ? "24px" : "32px"};
4623
+ height: ${({ sizeVar }) => sizeVar === "XS" ? "24px" : "32px"};
4612
4624
  border-radius: ${exports.borderRadiusTokens.borderRadius08};
4613
4625
  background-color: ${({ isActive }) => isActive ? exports.colorTokens.neutral300 : exports.colorTokens.neutral0};
4614
4626
  cursor: pointer;
@@ -4616,6 +4628,12 @@ var PageItem = styled6__default.default.button`
4616
4628
  &:hover {
4617
4629
  background-color: ${({ isActive }) => isActive ? exports.colorTokens.neutral300 : exports.colorTokens.neutral100};
4618
4630
  }
4631
+
4632
+ &.hada-responsive {
4633
+ @media (max-width: 720px) {
4634
+ display: none;
4635
+ }
4636
+ }
4619
4637
  `;
4620
4638
  var Ellipsis = styled6__default.default.div`
4621
4639
  display: flex;
@@ -4623,6 +4641,19 @@ var Ellipsis = styled6__default.default.div`
4623
4641
  align-items: center;
4624
4642
  width: 32px;
4625
4643
  height: 32px;
4644
+
4645
+ &.hada-responsive {
4646
+ @media (max-width: 720px) {
4647
+ display: none;
4648
+ }
4649
+ }
4650
+ `;
4651
+ var RightSourceWrapper = styled6__default.default.div`
4652
+ &.hada-responsive {
4653
+ @media (max-width: 720px) {
4654
+ display: none;
4655
+ }
4656
+ }
4626
4657
  `;
4627
4658
  var PaginationSizeSelector = ({ data, pageSize, setPageSize }) => {
4628
4659
  const { selectedItem, handleToggleSelect } = utils.useSelect("SINGLE", data, {
@@ -4664,7 +4695,8 @@ var Pagination = (_a) => {
4664
4695
  gotoPage,
4665
4696
  leftSource,
4666
4697
  rightSource,
4667
- totalCount
4698
+ totalCount,
4699
+ sizeVar = "S"
4668
4700
  } = _b, rest = __objRest(_b, [
4669
4701
  "currentPage",
4670
4702
  "pageCount",
@@ -4675,35 +4707,42 @@ var Pagination = (_a) => {
4675
4707
  "gotoPage",
4676
4708
  "leftSource",
4677
4709
  "rightSource",
4678
- "totalCount"
4710
+ "totalCount",
4711
+ "sizeVar"
4679
4712
  ]);
4713
+ const domain = exports.getDomain();
4714
+ const isHadaDomain = domain === "hada";
4715
+ const responsiveClassName = isHadaDomain ? "hada-responsive" : "";
4716
+ const isXSSize = sizeVar === "XS";
4680
4717
  const pageTotalCount = totalCount != null ? totalCount : Math.ceil(itemsTotalCount / Number(pageSize));
4681
4718
  const showLeftEllipsis = currentPage > pageCount - 1;
4682
4719
  const showRightEllipsis = currentPage < pageTotalCount && Math.ceil((currentPage + 1) / pageCount) < Math.ceil(pageTotalCount / pageCount);
4683
4720
  const canPreviousPage = currentPage > 0;
4684
4721
  const canNextPage = currentPage < pageTotalCount - 1;
4685
- return /* @__PURE__ */ jsxRuntime.jsxs(PaginationWrapper, __spreadProps(__spreadValues({}, rest), { children: [
4722
+ return /* @__PURE__ */ jsxRuntime.jsxs(PaginationWrapper, __spreadProps(__spreadValues({ className: responsiveClassName }, rest), { children: [
4686
4723
  leftSource ? leftSource : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
4687
- /* @__PURE__ */ jsxRuntime.jsxs(StyledPagination, { "data-shoplflow": "Pagination", children: [
4688
- /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canPreviousPage, onClick: () => gotoPage(0), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.FirstPageIcon, color: "neutral400", sizeVar: "S" }) }),
4689
- /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", onClick: previousPage, disabled: !canPreviousPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.LeftArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4690
- showLeftEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
4724
+ /* @__PURE__ */ jsxRuntime.jsxs(StyledPagination, { className: responsiveClassName, "data-shoplflow": "Pagination", children: [
4725
+ !isXSSize && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canPreviousPage, onClick: () => gotoPage(0), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.FirstPageIcon, color: "neutral400", sizeVar: "S" }) }),
4726
+ /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, styleVar: "GHOST", onClick: previousPage, disabled: !canPreviousPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.LeftArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4727
+ showLeftEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { className: responsiveClassName, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
4691
4728
  [...Array(pageTotalCount)].splice(0, pageCount).map(
4692
4729
  (_, idx) => idx + Math.floor(currentPage / pageCount) * pageCount < pageTotalCount && /* @__PURE__ */ jsxRuntime.jsx(
4693
4730
  PageItem,
4694
4731
  {
4732
+ sizeVar,
4733
+ className: responsiveClassName,
4695
4734
  isActive: currentPage === idx + Math.floor(currentPage / pageCount) * pageCount,
4696
4735
  onClick: () => gotoPage(idx + Math.floor(currentPage / pageCount) * pageCount),
4697
- children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount })
4736
+ children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: sizeVar === "XS" ? "caption_700" : "body2_700", children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount })
4698
4737
  },
4699
4738
  idx
4700
4739
  )
4701
4740
  ),
4702
- showRightEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
4703
- /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", onClick: nextPage, disabled: !canNextPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.RightArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4704
- /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canNextPage, onClick: () => gotoPage(pageTotalCount - 1), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.EndPageIcon, color: "neutral400", sizeVar: "S" }) })
4741
+ showRightEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { className: responsiveClassName, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
4742
+ /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, styleVar: "GHOST", onClick: nextPage, disabled: !canNextPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.RightArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4743
+ !isXSSize && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canNextPage, onClick: () => gotoPage(pageTotalCount - 1), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.EndPageIcon, color: "neutral400", sizeVar: "S" }) })
4705
4744
  ] }),
4706
- rightSource ? rightSource : /* @__PURE__ */ jsxRuntime.jsx("div", {})
4745
+ rightSource ? /* @__PURE__ */ jsxRuntime.jsx(RightSourceWrapper, { className: responsiveClassName, children: rightSource }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})
4707
4746
  ] }));
4708
4747
  };
4709
4748
  Pagination.SizeSelector = PaginationSizeSelector_default;
package/dist/index.d.cts CHANGED
@@ -1333,6 +1333,11 @@ interface PaginationOptionProps extends LeftAndRightNodeProps {
1333
1333
  * 내부 로직을 사용하지 않고, 외부에서 totalCount를 받을 수 있습니다
1334
1334
  */
1335
1335
  totalCount?: number;
1336
+ /**
1337
+ * 페이지네이션 크기
1338
+ * @default: 'S'
1339
+ */
1340
+ sizeVar?: 'S' | 'XS';
1336
1341
  previousPage: () => void;
1337
1342
  nextPage: () => void;
1338
1343
  gotoPage: (updater: ((pageIndex: number) => number) | number) => void;
@@ -1351,7 +1356,7 @@ interface PaginationSizeSelectorProps {
1351
1356
  }
1352
1357
 
1353
1358
  declare const Pagination: {
1354
- ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1359
+ ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, sizeVar, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1355
1360
  SizeSelector: ({ data, pageSize, setPageSize }: PaginationSizeSelectorProps) => react_jsx_runtime.JSX.Element;
1356
1361
  };
1357
1362
 
package/dist/index.d.ts CHANGED
@@ -1333,6 +1333,11 @@ interface PaginationOptionProps extends LeftAndRightNodeProps {
1333
1333
  * 내부 로직을 사용하지 않고, 외부에서 totalCount를 받을 수 있습니다
1334
1334
  */
1335
1335
  totalCount?: number;
1336
+ /**
1337
+ * 페이지네이션 크기
1338
+ * @default: 'S'
1339
+ */
1340
+ sizeVar?: 'S' | 'XS';
1336
1341
  previousPage: () => void;
1337
1342
  nextPage: () => void;
1338
1343
  gotoPage: (updater: ((pageIndex: number) => number) | number) => void;
@@ -1351,7 +1356,7 @@ interface PaginationSizeSelectorProps {
1351
1356
  }
1352
1357
 
1353
1358
  declare const Pagination: {
1354
- ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1359
+ ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, sizeVar, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1355
1360
  SizeSelector: ({ data, pageSize, setPageSize }: PaginationSizeSelectorProps) => react_jsx_runtime.JSX.Element;
1356
1361
  };
1357
1362
 
package/dist/index.js CHANGED
@@ -4571,17 +4571,29 @@ var PaginationWrapper = styled6.div`
4571
4571
  align-items: center;
4572
4572
  width: 100%;
4573
4573
  justify-content: space-between;
4574
+
4575
+ &.hada-responsive {
4576
+ @media (max-width: 720px) {
4577
+ justify-content: space-between;
4578
+ }
4579
+ }
4574
4580
  `;
4575
4581
  var StyledPagination = styled6.nav`
4576
4582
  display: flex;
4577
4583
  align-items: center;
4584
+
4585
+ &.hada-responsive {
4586
+ @media (max-width: 720px) {
4587
+ margin-left: auto;
4588
+ }
4589
+ }
4578
4590
  `;
4579
4591
  var PageItem = styled6.button`
4580
4592
  display: flex;
4581
4593
  justify-content: center;
4582
4594
  align-items: center;
4583
- width: 32px;
4584
- height: 32px;
4595
+ width: ${({ sizeVar }) => sizeVar === "XS" ? "24px" : "32px"};
4596
+ height: ${({ sizeVar }) => sizeVar === "XS" ? "24px" : "32px"};
4585
4597
  border-radius: ${borderRadiusTokens.borderRadius08};
4586
4598
  background-color: ${({ isActive }) => isActive ? colorTokens.neutral300 : colorTokens.neutral0};
4587
4599
  cursor: pointer;
@@ -4589,6 +4601,12 @@ var PageItem = styled6.button`
4589
4601
  &:hover {
4590
4602
  background-color: ${({ isActive }) => isActive ? colorTokens.neutral300 : colorTokens.neutral100};
4591
4603
  }
4604
+
4605
+ &.hada-responsive {
4606
+ @media (max-width: 720px) {
4607
+ display: none;
4608
+ }
4609
+ }
4592
4610
  `;
4593
4611
  var Ellipsis = styled6.div`
4594
4612
  display: flex;
@@ -4596,6 +4614,19 @@ var Ellipsis = styled6.div`
4596
4614
  align-items: center;
4597
4615
  width: 32px;
4598
4616
  height: 32px;
4617
+
4618
+ &.hada-responsive {
4619
+ @media (max-width: 720px) {
4620
+ display: none;
4621
+ }
4622
+ }
4623
+ `;
4624
+ var RightSourceWrapper = styled6.div`
4625
+ &.hada-responsive {
4626
+ @media (max-width: 720px) {
4627
+ display: none;
4628
+ }
4629
+ }
4599
4630
  `;
4600
4631
  var PaginationSizeSelector = ({ data, pageSize, setPageSize }) => {
4601
4632
  const { selectedItem, handleToggleSelect } = useSelect("SINGLE", data, {
@@ -4637,7 +4668,8 @@ var Pagination = (_a) => {
4637
4668
  gotoPage,
4638
4669
  leftSource,
4639
4670
  rightSource,
4640
- totalCount
4671
+ totalCount,
4672
+ sizeVar = "S"
4641
4673
  } = _b, rest = __objRest(_b, [
4642
4674
  "currentPage",
4643
4675
  "pageCount",
@@ -4648,35 +4680,42 @@ var Pagination = (_a) => {
4648
4680
  "gotoPage",
4649
4681
  "leftSource",
4650
4682
  "rightSource",
4651
- "totalCount"
4683
+ "totalCount",
4684
+ "sizeVar"
4652
4685
  ]);
4686
+ const domain = getDomain();
4687
+ const isHadaDomain = domain === "hada";
4688
+ const responsiveClassName = isHadaDomain ? "hada-responsive" : "";
4689
+ const isXSSize = sizeVar === "XS";
4653
4690
  const pageTotalCount = totalCount != null ? totalCount : Math.ceil(itemsTotalCount / Number(pageSize));
4654
4691
  const showLeftEllipsis = currentPage > pageCount - 1;
4655
4692
  const showRightEllipsis = currentPage < pageTotalCount && Math.ceil((currentPage + 1) / pageCount) < Math.ceil(pageTotalCount / pageCount);
4656
4693
  const canPreviousPage = currentPage > 0;
4657
4694
  const canNextPage = currentPage < pageTotalCount - 1;
4658
- return /* @__PURE__ */ jsxs(PaginationWrapper, __spreadProps(__spreadValues({}, rest), { children: [
4695
+ return /* @__PURE__ */ jsxs(PaginationWrapper, __spreadProps(__spreadValues({ className: responsiveClassName }, rest), { children: [
4659
4696
  leftSource ? leftSource : /* @__PURE__ */ jsx("div", {}),
4660
- /* @__PURE__ */ jsxs(StyledPagination, { "data-shoplflow": "Pagination", children: [
4661
- /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", disabled: !canPreviousPage, onClick: () => gotoPage(0), children: /* @__PURE__ */ jsx(Icon_default, { iconSource: FirstPageIcon, color: "neutral400", sizeVar: "S" }) }),
4662
- /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", onClick: previousPage, disabled: !canPreviousPage, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: LeftArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4663
- showLeftEllipsis && /* @__PURE__ */ jsx(Ellipsis, { children: /* @__PURE__ */ jsx(Text_default, { typography: "body2_700", children: "..." }) }),
4697
+ /* @__PURE__ */ jsxs(StyledPagination, { className: responsiveClassName, "data-shoplflow": "Pagination", children: [
4698
+ !isXSSize && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", disabled: !canPreviousPage, onClick: () => gotoPage(0), children: /* @__PURE__ */ jsx(Icon_default, { iconSource: FirstPageIcon, color: "neutral400", sizeVar: "S" }) }),
4699
+ /* @__PURE__ */ jsx(IconButton_default, { sizeVar, styleVar: "GHOST", onClick: previousPage, disabled: !canPreviousPage, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: LeftArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4700
+ showLeftEllipsis && /* @__PURE__ */ jsx(Ellipsis, { className: responsiveClassName, children: /* @__PURE__ */ jsx(Text_default, { typography: "body2_700", children: "..." }) }),
4664
4701
  [...Array(pageTotalCount)].splice(0, pageCount).map(
4665
4702
  (_, idx) => idx + Math.floor(currentPage / pageCount) * pageCount < pageTotalCount && /* @__PURE__ */ jsx(
4666
4703
  PageItem,
4667
4704
  {
4705
+ sizeVar,
4706
+ className: responsiveClassName,
4668
4707
  isActive: currentPage === idx + Math.floor(currentPage / pageCount) * pageCount,
4669
4708
  onClick: () => gotoPage(idx + Math.floor(currentPage / pageCount) * pageCount),
4670
- children: /* @__PURE__ */ jsx(Text_default, { typography: "body2_700", children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount })
4709
+ children: /* @__PURE__ */ jsx(Text_default, { typography: sizeVar === "XS" ? "caption_700" : "body2_700", children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount })
4671
4710
  },
4672
4711
  idx
4673
4712
  )
4674
4713
  ),
4675
- showRightEllipsis && /* @__PURE__ */ jsx(Ellipsis, { children: /* @__PURE__ */ jsx(Text_default, { typography: "body2_700", children: "..." }) }),
4676
- /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", onClick: nextPage, disabled: !canNextPage, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: RightArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4677
- /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", disabled: !canNextPage, onClick: () => gotoPage(pageTotalCount - 1), children: /* @__PURE__ */ jsx(Icon_default, { iconSource: EndPageIcon, color: "neutral400", sizeVar: "S" }) })
4714
+ showRightEllipsis && /* @__PURE__ */ jsx(Ellipsis, { className: responsiveClassName, children: /* @__PURE__ */ jsx(Text_default, { typography: "body2_700", children: "..." }) }),
4715
+ /* @__PURE__ */ jsx(IconButton_default, { sizeVar, styleVar: "GHOST", onClick: nextPage, disabled: !canNextPage, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: RightArrowIcon, color: "neutral400", sizeVar: "S" }) }),
4716
+ !isXSSize && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", styleVar: "GHOST", disabled: !canNextPage, onClick: () => gotoPage(pageTotalCount - 1), children: /* @__PURE__ */ jsx(Icon_default, { iconSource: EndPageIcon, color: "neutral400", sizeVar: "S" }) })
4678
4717
  ] }),
4679
- rightSource ? rightSource : /* @__PURE__ */ jsx("div", {})
4718
+ rightSource ? /* @__PURE__ */ jsx(RightSourceWrapper, { className: responsiveClassName, children: rightSource }) : /* @__PURE__ */ jsx("div", {})
4680
4719
  ] }));
4681
4720
  };
4682
4721
  Pagination.SizeSelector = PaginationSizeSelector_default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/base",
3
- "version": "0.41.5",
3
+ "version": "0.41.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -91,7 +91,7 @@
91
91
  "react-dom": "^18.2.0",
92
92
  "simplebar-react": "^3.2.6",
93
93
  "@shoplflow/hada-assets": "^0.1.6",
94
- "@shoplflow/shopl-assets": "^0.12.19",
94
+ "@shoplflow/shopl-assets": "^0.12.20",
95
95
  "@shoplflow/utils": "^0.6.5"
96
96
  },
97
97
  "scripts": {