@clickpalm/react 1.3.8 → 1.3.9

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.d.ts CHANGED
@@ -4136,6 +4136,7 @@ declare const Carousel: react__default.FC<CarouselProps> & {
4136
4136
  interface CarouselItemProps {
4137
4137
  children: ReactNode;
4138
4138
  style?: CSSProperties;
4139
+ title?: string | null | undefined;
4139
4140
  }
4140
4141
 
4141
4142
  type PasswordInputProps = Omit<TextInputProps, 'type' | 'suffix'>;
package/dist/index.js CHANGED
@@ -2319,7 +2319,6 @@ var TabsTrigger = styled(Tabs.Trigger, {
2319
2319
  whiteSpace: "nowrap",
2320
2320
  textOverflow: "ellipsis",
2321
2321
  overflow: "hidden",
2322
- userSelect: "none",
2323
2322
  background: "$gray100",
2324
2323
  backgroundImage: "linear-gradient(to bottom, $clickpalm_mid, $clickpalm_superDark)",
2325
2324
  WebkitBackgroundClip: "text",
@@ -3966,8 +3965,7 @@ var CarouselContainer = styled("div", {
3966
3965
  flexDirection: "column",
3967
3966
  alignItems: "center",
3968
3967
  width: "100%",
3969
- maxWidth: "720px",
3970
- userSelect: "none"
3968
+ maxWidth: "720px"
3971
3969
  });
3972
3970
  var Wrapper6 = styled("div", {
3973
3971
  display: "flex",
@@ -4061,6 +4059,13 @@ var DotButton = styled("button", {
4061
4059
  borderColor: "$ignite_dark"
4062
4060
  }
4063
4061
  });
4062
+ var Ellipsis = styled("span", {
4063
+ color: "$ignite_light",
4064
+ textDecoration: "none",
4065
+ height: "9px",
4066
+ display: "flex",
4067
+ alignItems: "center"
4068
+ });
4064
4069
  var CarouselItemContainer = styled("div", {
4065
4070
  width: "100%"
4066
4071
  });
@@ -4100,6 +4105,8 @@ var Carousel = ({ title, variant, children }) => {
4100
4105
  setTouchStartX(null);
4101
4106
  setTouchEndX(null);
4102
4107
  };
4108
+ const activeItem = items[activeIndex];
4109
+ const itemTitle = activeItem.props.title;
4103
4110
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4104
4111
  CarouselContainer,
4105
4112
  {
@@ -4109,7 +4116,7 @@ var Carousel = ({ title, variant, children }) => {
4109
4116
  children: [
4110
4117
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Wrapper6, { variant, children: [
4111
4118
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(CarouselHeader, { children: [
4112
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Title2, { children: title }),
4119
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Title2, { children: itemTitle ?? title }),
4113
4120
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Navigation, { children: [
4114
4121
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4115
4122
  Button,
@@ -4156,23 +4163,37 @@ var Carousel = ({ title, variant, children }) => {
4156
4163
  )
4157
4164
  ] }),
4158
4165
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Spacing, { size: "md" }),
4159
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DotsContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Dots2, { role: "tablist", "aria-label": "Carousel Pagination", children: items.map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4160
- DotButton,
4161
- {
4162
- active: idx === activeIndex,
4163
- "aria-label": `Go to slide ${idx + 1}`,
4164
- "aria-selected": idx === activeIndex,
4165
- role: "tab",
4166
- onClick: () => setActiveIndex(idx),
4167
- type: "button"
4168
- },
4169
- idx
4170
- )) }) })
4166
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DotsContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Dots2, { role: "tablist", "aria-label": "Carousel Pagination", children: getPaginationItems(items.length, activeIndex).map(
4167
+ (page, index) => typeof page === "number" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4168
+ DotButton,
4169
+ {
4170
+ active: page === activeIndex,
4171
+ "aria-label": `Go to slide ${page + 1}`,
4172
+ "aria-selected": page === activeIndex,
4173
+ role: "tab",
4174
+ onClick: () => setActiveIndex(page),
4175
+ type: "button"
4176
+ },
4177
+ page
4178
+ ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Ellipsis, { children: "..." }, `ellipsis-${index}`)
4179
+ ) }) })
4171
4180
  ]
4172
4181
  }
4173
4182
  );
4174
4183
  };
4175
- var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CarouselItemContainer, { ...props, style: { ...style }, children });
4184
+ var getPaginationItems = (totalItems, activeIndex) => {
4185
+ if (totalItems <= 10) {
4186
+ return Array.from({ length: totalItems }, (_, i) => i);
4187
+ }
4188
+ if (activeIndex < 7) {
4189
+ return [0, 1, 2, 3, 4, 5, 6, "...", totalItems - 1];
4190
+ }
4191
+ if (activeIndex >= totalItems - 5) {
4192
+ return [0, "...", totalItems - 5, totalItems - 4, totalItems - 3, totalItems - 2, totalItems - 1];
4193
+ }
4194
+ return [0, "...", activeIndex - 2, activeIndex - 1, activeIndex, activeIndex + 1, activeIndex + 2, "...", totalItems - 1];
4195
+ };
4196
+ var CarouselItem = ({ children, style, title, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CarouselItemContainer, { ...props, style: { ...style }, children });
4176
4197
  Carousel.Item = CarouselItem;
4177
4198
 
4178
4199
  // src/components/PasswordInput.tsx
package/dist/index.mjs CHANGED
@@ -2249,7 +2249,6 @@ var TabsTrigger = styled(Tabs.Trigger, {
2249
2249
  whiteSpace: "nowrap",
2250
2250
  textOverflow: "ellipsis",
2251
2251
  overflow: "hidden",
2252
- userSelect: "none",
2253
2252
  background: "$gray100",
2254
2253
  backgroundImage: "linear-gradient(to bottom, $clickpalm_mid, $clickpalm_superDark)",
2255
2254
  WebkitBackgroundClip: "text",
@@ -3900,8 +3899,7 @@ var CarouselContainer = styled("div", {
3900
3899
  flexDirection: "column",
3901
3900
  alignItems: "center",
3902
3901
  width: "100%",
3903
- maxWidth: "720px",
3904
- userSelect: "none"
3902
+ maxWidth: "720px"
3905
3903
  });
3906
3904
  var Wrapper6 = styled("div", {
3907
3905
  display: "flex",
@@ -3995,6 +3993,13 @@ var DotButton = styled("button", {
3995
3993
  borderColor: "$ignite_dark"
3996
3994
  }
3997
3995
  });
3996
+ var Ellipsis = styled("span", {
3997
+ color: "$ignite_light",
3998
+ textDecoration: "none",
3999
+ height: "9px",
4000
+ display: "flex",
4001
+ alignItems: "center"
4002
+ });
3998
4003
  var CarouselItemContainer = styled("div", {
3999
4004
  width: "100%"
4000
4005
  });
@@ -4034,6 +4039,8 @@ var Carousel = ({ title, variant, children }) => {
4034
4039
  setTouchStartX(null);
4035
4040
  setTouchEndX(null);
4036
4041
  };
4042
+ const activeItem = items[activeIndex];
4043
+ const itemTitle = activeItem.props.title;
4037
4044
  return /* @__PURE__ */ jsxs20(
4038
4045
  CarouselContainer,
4039
4046
  {
@@ -4043,7 +4050,7 @@ var Carousel = ({ title, variant, children }) => {
4043
4050
  children: [
4044
4051
  /* @__PURE__ */ jsxs20(Wrapper6, { variant, children: [
4045
4052
  /* @__PURE__ */ jsxs20(CarouselHeader, { children: [
4046
- /* @__PURE__ */ jsx43(Title2, { children: title }),
4053
+ /* @__PURE__ */ jsx43(Title2, { children: itemTitle ?? title }),
4047
4054
  /* @__PURE__ */ jsxs20(Navigation, { children: [
4048
4055
  /* @__PURE__ */ jsx43(
4049
4056
  Button,
@@ -4090,23 +4097,37 @@ var Carousel = ({ title, variant, children }) => {
4090
4097
  )
4091
4098
  ] }),
4092
4099
  /* @__PURE__ */ jsx43(Spacing, { size: "md" }),
4093
- /* @__PURE__ */ jsx43(DotsContainer, { children: /* @__PURE__ */ jsx43(Dots2, { role: "tablist", "aria-label": "Carousel Pagination", children: items.map((_, idx) => /* @__PURE__ */ jsx43(
4094
- DotButton,
4095
- {
4096
- active: idx === activeIndex,
4097
- "aria-label": `Go to slide ${idx + 1}`,
4098
- "aria-selected": idx === activeIndex,
4099
- role: "tab",
4100
- onClick: () => setActiveIndex(idx),
4101
- type: "button"
4102
- },
4103
- idx
4104
- )) }) })
4100
+ /* @__PURE__ */ jsx43(DotsContainer, { children: /* @__PURE__ */ jsx43(Dots2, { role: "tablist", "aria-label": "Carousel Pagination", children: getPaginationItems(items.length, activeIndex).map(
4101
+ (page, index) => typeof page === "number" ? /* @__PURE__ */ jsx43(
4102
+ DotButton,
4103
+ {
4104
+ active: page === activeIndex,
4105
+ "aria-label": `Go to slide ${page + 1}`,
4106
+ "aria-selected": page === activeIndex,
4107
+ role: "tab",
4108
+ onClick: () => setActiveIndex(page),
4109
+ type: "button"
4110
+ },
4111
+ page
4112
+ ) : /* @__PURE__ */ jsx43(Ellipsis, { children: "..." }, `ellipsis-${index}`)
4113
+ ) }) })
4105
4114
  ]
4106
4115
  }
4107
4116
  );
4108
4117
  };
4109
- var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ jsx43(CarouselItemContainer, { ...props, style: { ...style }, children });
4118
+ var getPaginationItems = (totalItems, activeIndex) => {
4119
+ if (totalItems <= 10) {
4120
+ return Array.from({ length: totalItems }, (_, i) => i);
4121
+ }
4122
+ if (activeIndex < 7) {
4123
+ return [0, 1, 2, 3, 4, 5, 6, "...", totalItems - 1];
4124
+ }
4125
+ if (activeIndex >= totalItems - 5) {
4126
+ return [0, "...", totalItems - 5, totalItems - 4, totalItems - 3, totalItems - 2, totalItems - 1];
4127
+ }
4128
+ return [0, "...", activeIndex - 2, activeIndex - 1, activeIndex, activeIndex + 1, activeIndex + 2, "...", totalItems - 1];
4129
+ };
4130
+ var CarouselItem = ({ children, style, title, ...props }) => /* @__PURE__ */ jsx43(CarouselItemContainer, { ...props, style: { ...style }, children });
4110
4131
  Carousel.Item = CarouselItem;
4111
4132
 
4112
4133
  // src/components/PasswordInput.tsx
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Design System da Clikpalm",
4
4
  "author": "Enisson Shilo",
5
5
  "license": "MIT",
6
- "version": "1.3.8",
6
+ "version": "1.3.9",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/clickpalm/clickpalm-designsystem-lib.git"