@lets-events/react 7.2.0 → 8.0.0

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.js CHANGED
@@ -1030,6 +1030,9 @@ __export(index_exports, {
1030
1030
  ButtonItem: () => ButtonItem,
1031
1031
  ButtonItemStyled: () => ButtonItemStyled,
1032
1032
  Calendar: () => Calendar,
1033
+ Card: () => Card,
1034
+ CardContainer: () => CardContainer,
1035
+ CardStyled: () => CardStyled,
1033
1036
  CheckboxGroup: () => CheckboxGroup,
1034
1037
  CheckboxGroupStyled: () => CheckboxGroupStyled,
1035
1038
  CheckboxItem: () => CheckboxItem,
@@ -9080,11 +9083,66 @@ function StepWrapper(_a) {
9080
9083
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_themes17.Box, __spreadProps(__spreadValues({}, props), { children }));
9081
9084
  }
9082
9085
 
9083
- // src/components/TextareaField.tsx
9086
+ // src/components/Card.tsx
9087
+ var import_react8 = __toESM(require("react"));
9084
9088
  var import_themes18 = require("@radix-ui/themes");
9085
- var import_react8 = require("react");
9086
9089
  var import_jsx_runtime19 = require("react/jsx-runtime");
9087
- var TextareaFieldStyle = styled(import_themes18.TextArea, {
9090
+ var CardStyled = styled(import_themes18.Card, {
9091
+ display: "flex",
9092
+ flexDirection: "column",
9093
+ width: "370px",
9094
+ borderRadius: "$2xl",
9095
+ border: "1px solid $dark100",
9096
+ overflow: "hidden",
9097
+ padding: "16px",
9098
+ defaultVariants: {
9099
+ color: "primary",
9100
+ boxShadow: true
9101
+ },
9102
+ variants: {
9103
+ color: {
9104
+ primary: {
9105
+ backgroundColor: "$dark50",
9106
+ border: "1px solid $dark200"
9107
+ },
9108
+ disable: {
9109
+ backgroundColor: "$grey50",
9110
+ border: "1px solid $dark200"
9111
+ },
9112
+ error: {
9113
+ backgroundColor: "$error50",
9114
+ border: "1px solid $error600"
9115
+ }
9116
+ },
9117
+ boxShadow: {
9118
+ true: {
9119
+ boxShadow: "0 2px 4px rgba(35, 53, 67, 0.16), 0 4px 4px rgba(35, 53, 67, 0.08)"
9120
+ },
9121
+ false: {
9122
+ boxShadow: "none"
9123
+ }
9124
+ }
9125
+ }
9126
+ });
9127
+ var CardContainer = styled(import_themes18.Box, {
9128
+ display: "flex",
9129
+ flexDirection: "row"
9130
+ });
9131
+ function Card(_a) {
9132
+ var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
9133
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CardStyled, __spreadProps(__spreadValues({}, props), { children: import_react8.default.Children.map(children, (child) => {
9134
+ if (import_react8.default.isValidElement(child)) {
9135
+ return import_react8.default.cloneElement(child, { size: props.size });
9136
+ }
9137
+ return child;
9138
+ }) }));
9139
+ }
9140
+
9141
+ // src/components/TextareaField.tsx
9142
+ var import_themes19 = require("@radix-ui/themes");
9143
+ var import_react9 = require("react");
9144
+ var import_jsx_runtime20 = require("react/jsx-runtime");
9145
+ var TextareaFieldStyle = styled(import_themes19.TextArea, {
9088
9146
  display: "flex",
9089
9147
  width: "fit-content",
9090
9148
  flex: 1,
@@ -9141,18 +9199,18 @@ var TextareaLimitIndicator = styled("div", {
9141
9199
  });
9142
9200
  function TextareaField(_a) {
9143
9201
  var _b = _a, { maxLength } = _b, props = __objRest(_b, ["maxLength"]);
9144
- const inputRef = (0, import_react8.useRef)(null);
9145
- const badgeRef = (0, import_react8.useRef)(null);
9202
+ const inputRef = (0, import_react9.useRef)(null);
9203
+ const badgeRef = (0, import_react9.useRef)(null);
9146
9204
  if (!maxLength) {
9147
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TextareaContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
9205
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
9148
9206
  }
9149
9207
  const handleInput = () => {
9150
9208
  var _a2;
9151
9209
  const remainingChars = maxLength - (((_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.value.length) || 0);
9152
9210
  if (badgeRef.current) badgeRef.current.textContent = String(remainingChars);
9153
9211
  };
9154
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(TextareaContainer, { css: { paddingBottom: "3.25rem" }, children: [
9155
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
9212
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(TextareaContainer, { css: { paddingBottom: "3.25rem" }, children: [
9213
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
9156
9214
  TextareaFieldStyle,
9157
9215
  __spreadValues({
9158
9216
  ref: inputRef,
@@ -9160,14 +9218,14 @@ function TextareaField(_a) {
9160
9218
  maxLength
9161
9219
  }, props)
9162
9220
  ),
9163
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TextareaLimitIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { typography: "badgeMedium", ref: badgeRef, children: maxLength }) })
9221
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaLimitIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { typography: "badgeMedium", ref: badgeRef, children: maxLength }) })
9164
9222
  ] });
9165
9223
  }
9166
9224
 
9167
9225
  // src/components/Grid.tsx
9168
- var import_themes19 = require("@radix-ui/themes");
9169
- var import_jsx_runtime20 = require("react/jsx-runtime");
9170
- var GridStyled = styled(import_themes19.Grid, {
9226
+ var import_themes20 = require("@radix-ui/themes");
9227
+ var import_jsx_runtime21 = require("react/jsx-runtime");
9228
+ var GridStyled = styled(import_themes20.Grid, {
9171
9229
  display: "grid",
9172
9230
  variants: {
9173
9231
  display: {
@@ -9288,13 +9346,13 @@ var GridStyled = styled(import_themes19.Grid, {
9288
9346
  });
9289
9347
  function Grid(_a) {
9290
9348
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9291
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
9349
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
9292
9350
  }
9293
9351
 
9294
9352
  // src/components/Container.tsx
9295
- var import_themes20 = require("@radix-ui/themes");
9296
- var import_jsx_runtime21 = require("react/jsx-runtime");
9297
- var ContainerStyled = styled(import_themes20.Container, {
9353
+ var import_themes21 = require("@radix-ui/themes");
9354
+ var import_jsx_runtime22 = require("react/jsx-runtime");
9355
+ var ContainerStyled = styled(import_themes21.Container, {
9298
9356
  variants: {
9299
9357
  size: {
9300
9358
  xs: { maxWidth: "576px" },
@@ -9323,13 +9381,13 @@ var ContainerStyled = styled(import_themes20.Container, {
9323
9381
  });
9324
9382
  function Container(_a) {
9325
9383
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9326
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
9384
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
9327
9385
  }
9328
9386
 
9329
9387
  // src/components/Section.tsx
9330
- var import_themes21 = require("@radix-ui/themes");
9331
- var import_jsx_runtime22 = require("react/jsx-runtime");
9332
- var SectionStyled = styled(import_themes21.Section, {
9388
+ var import_themes22 = require("@radix-ui/themes");
9389
+ var import_jsx_runtime23 = require("react/jsx-runtime");
9390
+ var SectionStyled = styled(import_themes22.Section, {
9333
9391
  variants: {
9334
9392
  size: {
9335
9393
  xs: { maxWidth: "576px" },
@@ -9352,7 +9410,7 @@ var SectionStyled = styled(import_themes21.Section, {
9352
9410
  });
9353
9411
  function Section(_a) {
9354
9412
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9355
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
9413
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
9356
9414
  }
9357
9415
  // Annotate the CommonJS export names for ESM import in node:
9358
9416
  0 && (module.exports = {
@@ -9375,6 +9433,9 @@ function Section(_a) {
9375
9433
  ButtonItem,
9376
9434
  ButtonItemStyled,
9377
9435
  Calendar,
9436
+ Card,
9437
+ CardContainer,
9438
+ CardStyled,
9378
9439
  CheckboxGroup,
9379
9440
  CheckboxGroupStyled,
9380
9441
  CheckboxItem,
package/dist/index.mjs CHANGED
@@ -9003,10 +9003,65 @@ function StepWrapper(_a) {
9003
9003
  return /* @__PURE__ */ jsx18(Box2, __spreadProps(__spreadValues({}, props), { children }));
9004
9004
  }
9005
9005
 
9006
+ // src/components/Card.tsx
9007
+ import React5 from "react";
9008
+ import { Box as Box3, Card as CardRadix } from "@radix-ui/themes";
9009
+ import { jsx as jsx19 } from "react/jsx-runtime";
9010
+ var CardStyled = styled(CardRadix, {
9011
+ display: "flex",
9012
+ flexDirection: "column",
9013
+ width: "370px",
9014
+ borderRadius: "$2xl",
9015
+ border: "1px solid $dark100",
9016
+ overflow: "hidden",
9017
+ padding: "16px",
9018
+ defaultVariants: {
9019
+ color: "primary",
9020
+ boxShadow: true
9021
+ },
9022
+ variants: {
9023
+ color: {
9024
+ primary: {
9025
+ backgroundColor: "$dark50",
9026
+ border: "1px solid $dark200"
9027
+ },
9028
+ disable: {
9029
+ backgroundColor: "$grey50",
9030
+ border: "1px solid $dark200"
9031
+ },
9032
+ error: {
9033
+ backgroundColor: "$error50",
9034
+ border: "1px solid $error600"
9035
+ }
9036
+ },
9037
+ boxShadow: {
9038
+ true: {
9039
+ boxShadow: "0 2px 4px rgba(35, 53, 67, 0.16), 0 4px 4px rgba(35, 53, 67, 0.08)"
9040
+ },
9041
+ false: {
9042
+ boxShadow: "none"
9043
+ }
9044
+ }
9045
+ }
9046
+ });
9047
+ var CardContainer = styled(Box3, {
9048
+ display: "flex",
9049
+ flexDirection: "row"
9050
+ });
9051
+ function Card(_a) {
9052
+ var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
9053
+ return /* @__PURE__ */ jsx19(CardStyled, __spreadProps(__spreadValues({}, props), { children: React5.Children.map(children, (child) => {
9054
+ if (React5.isValidElement(child)) {
9055
+ return React5.cloneElement(child, { size: props.size });
9056
+ }
9057
+ return child;
9058
+ }) }));
9059
+ }
9060
+
9006
9061
  // src/components/TextareaField.tsx
9007
9062
  import { TextArea as TextAreaRadix } from "@radix-ui/themes";
9008
9063
  import { useRef as useRef3 } from "react";
9009
- import { jsx as jsx19, jsxs as jsxs8 } from "react/jsx-runtime";
9064
+ import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
9010
9065
  var TextareaFieldStyle = styled(TextAreaRadix, {
9011
9066
  display: "flex",
9012
9067
  width: "fit-content",
@@ -9067,7 +9122,7 @@ function TextareaField(_a) {
9067
9122
  const inputRef = useRef3(null);
9068
9123
  const badgeRef = useRef3(null);
9069
9124
  if (!maxLength) {
9070
- return /* @__PURE__ */ jsx19(TextareaContainer, { children: /* @__PURE__ */ jsx19(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
9125
+ return /* @__PURE__ */ jsx20(TextareaContainer, { children: /* @__PURE__ */ jsx20(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
9071
9126
  }
9072
9127
  const handleInput = () => {
9073
9128
  var _a2;
@@ -9075,7 +9130,7 @@ function TextareaField(_a) {
9075
9130
  if (badgeRef.current) badgeRef.current.textContent = String(remainingChars);
9076
9131
  };
9077
9132
  return /* @__PURE__ */ jsxs8(TextareaContainer, { css: { paddingBottom: "3.25rem" }, children: [
9078
- /* @__PURE__ */ jsx19(
9133
+ /* @__PURE__ */ jsx20(
9079
9134
  TextareaFieldStyle,
9080
9135
  __spreadValues({
9081
9136
  ref: inputRef,
@@ -9083,13 +9138,13 @@ function TextareaField(_a) {
9083
9138
  maxLength
9084
9139
  }, props)
9085
9140
  ),
9086
- /* @__PURE__ */ jsx19(TextareaLimitIndicator, { children: /* @__PURE__ */ jsx19(Text, { typography: "badgeMedium", ref: badgeRef, children: maxLength }) })
9141
+ /* @__PURE__ */ jsx20(TextareaLimitIndicator, { children: /* @__PURE__ */ jsx20(Text, { typography: "badgeMedium", ref: badgeRef, children: maxLength }) })
9087
9142
  ] });
9088
9143
  }
9089
9144
 
9090
9145
  // src/components/Grid.tsx
9091
9146
  import { Grid as GridRadix } from "@radix-ui/themes";
9092
- import { jsx as jsx20 } from "react/jsx-runtime";
9147
+ import { jsx as jsx21 } from "react/jsx-runtime";
9093
9148
  var GridStyled = styled(GridRadix, {
9094
9149
  display: "grid",
9095
9150
  variants: {
@@ -9211,12 +9266,12 @@ var GridStyled = styled(GridRadix, {
9211
9266
  });
9212
9267
  function Grid(_a) {
9213
9268
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9214
- return /* @__PURE__ */ jsx20(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
9269
+ return /* @__PURE__ */ jsx21(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
9215
9270
  }
9216
9271
 
9217
9272
  // src/components/Container.tsx
9218
9273
  import { Container as ContainerRadix } from "@radix-ui/themes";
9219
- import { jsx as jsx21 } from "react/jsx-runtime";
9274
+ import { jsx as jsx22 } from "react/jsx-runtime";
9220
9275
  var ContainerStyled = styled(ContainerRadix, {
9221
9276
  variants: {
9222
9277
  size: {
@@ -9246,12 +9301,12 @@ var ContainerStyled = styled(ContainerRadix, {
9246
9301
  });
9247
9302
  function Container(_a) {
9248
9303
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9249
- return /* @__PURE__ */ jsx21(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
9304
+ return /* @__PURE__ */ jsx22(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
9250
9305
  }
9251
9306
 
9252
9307
  // src/components/Section.tsx
9253
9308
  import { Section as SectionRadix } from "@radix-ui/themes";
9254
- import { jsx as jsx22 } from "react/jsx-runtime";
9309
+ import { jsx as jsx23 } from "react/jsx-runtime";
9255
9310
  var SectionStyled = styled(SectionRadix, {
9256
9311
  variants: {
9257
9312
  size: {
@@ -9275,7 +9330,7 @@ var SectionStyled = styled(SectionRadix, {
9275
9330
  });
9276
9331
  function Section(_a) {
9277
9332
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
9278
- return /* @__PURE__ */ jsx22(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
9333
+ return /* @__PURE__ */ jsx23(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
9279
9334
  }
9280
9335
  export {
9281
9336
  Alert,
@@ -9297,6 +9352,9 @@ export {
9297
9352
  ButtonItem,
9298
9353
  ButtonItemStyled,
9299
9354
  Calendar,
9355
+ Card,
9356
+ CardContainer,
9357
+ CardStyled,
9300
9358
  CheckboxGroup,
9301
9359
  CheckboxGroupStyled,
9302
9360
  CheckboxItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "7.2.0",
3
+ "version": "8.0.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -2,7 +2,6 @@ import React from 'react'
2
2
  import { ComponentProps, ElementType } from 'react'
3
3
  import { styled } from '../styles'
4
4
  import { Badge as BadgeRadix } from '@radix-ui/themes'
5
- import { fontWeights } from '@lets-events/tokens'
6
5
  export const BadgeStyled = styled(BadgeRadix, {
7
6
  fontFamily: '$default',
8
7
  borderRadius: '$sm',
@@ -0,0 +1,69 @@
1
+ import React from 'react'
2
+ import { ComponentProps, ElementType } from 'react'
3
+ import { styled } from '../styles'
4
+ import { Box, Card as CardRadix } from '@radix-ui/themes'
5
+
6
+ export const CardStyled = styled(CardRadix, {
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ width: '370px',
10
+ borderRadius: '$2xl',
11
+ border: '1px solid $dark100',
12
+ overflow: 'hidden',
13
+ padding: '16px',
14
+ defaultVariants: {
15
+ color: 'primary',
16
+ boxShadow: true,
17
+ },
18
+ variants: {
19
+ color: {
20
+ primary: {
21
+ backgroundColor: '$dark50',
22
+ border: '1px solid $dark200',
23
+ },
24
+ disable: {
25
+ backgroundColor: '$grey50',
26
+ border: '1px solid $dark200',
27
+ },
28
+ error: {
29
+ backgroundColor: '$error50',
30
+ border: '1px solid $error600',
31
+ }
32
+ },
33
+ boxShadow:{
34
+ true: {
35
+ boxShadow: '0 2px 4px rgba(35, 53, 67, 0.16), 0 4px 4px rgba(35, 53, 67, 0.08)',
36
+ },
37
+ false: {
38
+ boxShadow: 'none',
39
+ }
40
+ }
41
+ }
42
+ });
43
+
44
+
45
+
46
+ export const CardContainer = styled(Box, {
47
+ display: 'flex',
48
+ flexDirection: 'row'
49
+ })
50
+
51
+ export type CardProps = ComponentProps<typeof CardStyled> & {
52
+ children: React.ReactNode
53
+ as?: ElementType
54
+ }
55
+
56
+
57
+
58
+ export function Card({ asChild, children, ...props }: CardProps) {
59
+ return (
60
+ <CardStyled {...props}>
61
+ {React.Children.map(children, (child) => {
62
+ if (React.isValidElement(child)) {
63
+ return React.cloneElement(child, { size: props.size } as any)
64
+ }
65
+ return child
66
+ })}
67
+ </CardStyled>
68
+ )
69
+ }
package/src/index.tsx CHANGED
@@ -20,6 +20,7 @@ export * from './components/TimePicker'
20
20
  export * from './components/Alert'
21
21
  export * from './components/Switch'
22
22
  export * from './components/Step'
23
+ export * from './components/Card'
23
24
  export * from './components/TextareaField'
24
25
 
25
26
  // Layouts