@olundot/ui 0.9.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @olundot/ui
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9bfcb6e: Add `bordered={false}` to `EmptyState` so embedded empty states can avoid nested container borders and backgrounds.
8
+
9
+ Add `fluid` to `OTPField` so narrow viewports keep OTP cells on one row while the default fixed-width layout remains unchanged.
10
+
3
11
  ## 0.9.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -980,6 +980,7 @@ declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttribu
980
980
 
981
981
  declare const emptyStateBaseVariants: (props?: ({
982
982
  size?: "sm" | "md" | "lg" | null | undefined;
983
+ bordered?: boolean | null | undefined;
983
984
  } & class_variance_authority_types.ClassProp) | undefined) => string;
984
985
  type EmptyStateTone = "neutral" | "muted" | "raised";
985
986
  interface EmptyStateVariantOptions extends VariantProps<typeof emptyStateBaseVariants> {
@@ -987,7 +988,7 @@ interface EmptyStateVariantOptions extends VariantProps<typeof emptyStateBaseVar
987
988
  surface?: SurfaceLevel;
988
989
  className?: string;
989
990
  }
990
- declare function emptyStateVariants({ size, tone, surface, className }?: EmptyStateVariantOptions): string;
991
+ declare function emptyStateVariants({ size, tone, surface, bordered, className, }?: EmptyStateVariantOptions): string;
991
992
  declare const emptyStateIconVariants: (props?: ({
992
993
  size?: "sm" | "md" | "lg" | null | undefined;
993
994
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -1203,9 +1204,11 @@ declare const otpFieldVariants: (props?: ({
1203
1204
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1204
1205
  declare const otpFieldGroupVariants: (props?: ({
1205
1206
  size?: "compact" | "default" | null | undefined;
1207
+ fluid?: boolean | null | undefined;
1206
1208
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1207
1209
  declare const otpCellVariants: (props?: ({
1208
1210
  size?: "compact" | "default" | null | undefined;
1211
+ fluid?: boolean | null | undefined;
1209
1212
  surface?: SurfaceLevel | null | undefined;
1210
1213
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1211
1214
  declare const otpFieldMessageVariants: (props?: ({
@@ -1224,6 +1227,7 @@ interface OTPFieldProps extends Omit<React.FieldsetHTMLAttributes<HTMLFieldSetEl
1224
1227
  onValueChange?: (value: string) => void;
1225
1228
  readOnly?: boolean;
1226
1229
  size?: OTPFieldSize;
1230
+ fluid?: boolean;
1227
1231
  /**
1228
1232
  * Background level for normal OTP cells. Filled, invalid, disabled, and
1229
1233
  * readOnly states take precedence.
package/dist/index.js CHANGED
@@ -6119,7 +6119,6 @@ import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
6119
6119
  var emptyStateBaseVariants = cva18(
6120
6120
  [
6121
6121
  "flex flex-col items-center justify-center text-center",
6122
- "rounded-[var(--radius-md)] border border-[var(--border-subtle)]",
6123
6122
  "text-foreground"
6124
6123
  ].join(" "),
6125
6124
  {
@@ -6128,10 +6127,15 @@ var emptyStateBaseVariants = cva18(
6128
6127
  sm: "gap-[var(--space-1)] px-[var(--space-2)] py-[var(--space-3)]",
6129
6128
  md: "gap-[var(--space-1-5)] px-[var(--space-3)] py-[var(--space-5)]",
6130
6129
  lg: "gap-[var(--space-2)] px-[var(--space-4)] py-[var(--space-6)]"
6130
+ },
6131
+ bordered: {
6132
+ true: "rounded-[var(--radius-md)] border border-[var(--border-subtle)]",
6133
+ false: ""
6131
6134
  }
6132
6135
  },
6133
6136
  defaultVariants: {
6134
- size: "md"
6137
+ size: "md",
6138
+ bordered: true
6135
6139
  }
6136
6140
  }
6137
6141
  );
@@ -6146,10 +6150,17 @@ function getEmptyStateToneSurface(tone) {
6146
6150
  return surfaceClassNames.surface;
6147
6151
  }
6148
6152
  }
6149
- function emptyStateVariants({ size, tone = "neutral", surface, className } = {}) {
6153
+ function emptyStateVariants({
6154
+ size,
6155
+ tone = "neutral",
6156
+ surface,
6157
+ bordered = true,
6158
+ className
6159
+ } = {}) {
6160
+ const hasBorder = bordered !== false;
6150
6161
  return cn(
6151
- emptyStateBaseVariants({ size }),
6152
- surface ? surfaceClassNames[surface] : getEmptyStateToneSurface(tone),
6162
+ emptyStateBaseVariants({ size, bordered: hasBorder }),
6163
+ hasBorder ? surface ? surfaceClassNames[surface] : getEmptyStateToneSurface(tone) : null,
6153
6164
  className
6154
6165
  );
6155
6166
  }
@@ -6187,6 +6198,7 @@ var EmptyState = React31.forwardRef(
6187
6198
  description,
6188
6199
  hint,
6189
6200
  action,
6201
+ bordered = true,
6190
6202
  ...props
6191
6203
  }, ref) => {
6192
6204
  const resolvedSize = size ?? "md";
@@ -6196,7 +6208,7 @@ var EmptyState = React31.forwardRef(
6196
6208
  ref,
6197
6209
  role: "status",
6198
6210
  "data-slot": "empty-state",
6199
- className: cn(emptyStateVariants({ size, tone, surface, className })),
6211
+ className: cn(emptyStateVariants({ size, tone, surface, bordered, className })),
6200
6212
  ...props,
6201
6213
  children: [
6202
6214
  Icon ? /* @__PURE__ */ jsx40(
@@ -7152,20 +7164,25 @@ var otpFieldVariants = cva25("flex w-full flex-col gap-[var(--space-1-5)]", {
7152
7164
  size: "default"
7153
7165
  }
7154
7166
  });
7155
- var otpFieldGroupVariants = cva25("flex flex-wrap items-start gap-[var(--space-1)] pt-[var(--space-0-5)]", {
7167
+ var otpFieldGroupVariants = cva25("flex items-start gap-[var(--space-1)] pt-[var(--space-0-5)]", {
7156
7168
  variants: {
7157
7169
  size: {
7158
7170
  default: "",
7159
7171
  compact: ""
7172
+ },
7173
+ fluid: {
7174
+ true: "flex-nowrap justify-center",
7175
+ false: "flex-wrap"
7160
7176
  }
7161
7177
  },
7162
7178
  defaultVariants: {
7163
- size: "default"
7179
+ size: "default",
7180
+ fluid: false
7164
7181
  }
7165
7182
  });
7166
7183
  var otpCellVariants = cva25(
7167
7184
  [
7168
- "flex shrink-0 items-center justify-center rounded-[var(--radius-sm)] border",
7185
+ "flex items-center justify-center rounded-[var(--radius-sm)] border",
7169
7186
  "border-[var(--border)] text-foreground",
7170
7187
  "font-[family-name:var(--font-display)] tabular-nums",
7171
7188
  "text-center leading-none caret-[var(--accent-fg)]",
@@ -7180,13 +7197,40 @@ var otpCellVariants = cva25(
7180
7197
  {
7181
7198
  variants: {
7182
7199
  size: {
7183
- default: "h-[60px] w-[52px] text-[24px]",
7184
- compact: "h-[52px] w-[44px] text-[20px]"
7200
+ default: "h-[60px] text-[24px]",
7201
+ compact: "h-[52px] text-[20px]"
7202
+ },
7203
+ fluid: {
7204
+ true: "min-w-0 flex-1",
7205
+ false: "shrink-0"
7185
7206
  },
7186
7207
  surface: fieldSurfaceClassNames
7187
7208
  },
7209
+ compoundVariants: [
7210
+ {
7211
+ size: "default",
7212
+ fluid: false,
7213
+ className: "w-[52px]"
7214
+ },
7215
+ {
7216
+ size: "compact",
7217
+ fluid: false,
7218
+ className: "w-[44px]"
7219
+ },
7220
+ {
7221
+ size: "default",
7222
+ fluid: true,
7223
+ className: "max-w-[52px]"
7224
+ },
7225
+ {
7226
+ size: "compact",
7227
+ fluid: true,
7228
+ className: "max-w-[44px]"
7229
+ }
7230
+ ],
7188
7231
  defaultVariants: {
7189
7232
  size: "default",
7233
+ fluid: false,
7190
7234
  surface: "surface"
7191
7235
  }
7192
7236
  }
@@ -7244,6 +7288,7 @@ var OTPField = React37.forwardRef(
7244
7288
  helperText,
7245
7289
  id,
7246
7290
  invalid,
7291
+ fluid = false,
7247
7292
  label,
7248
7293
  length = 6,
7249
7294
  name,
@@ -7320,7 +7365,7 @@ var OTPField = React37.forwardRef(
7320
7365
  "data-slot": "otp-field-group",
7321
7366
  "aria-labelledby": labelId,
7322
7367
  "aria-describedby": groupDescribedBy,
7323
- className: cn(otpFieldGroupVariants({ size })),
7368
+ className: cn(otpFieldGroupVariants({ size, fluid })),
7324
7369
  children: Array.from({ length }, (_, index) => {
7325
7370
  const digit = resolvedSlots[index] ?? "";
7326
7371
  const inputId = `${fieldId}-cell-${index + 1}`;
@@ -7412,7 +7457,7 @@ var OTPField = React37.forwardRef(
7412
7457
  onFocus: (event) => {
7413
7458
  event.currentTarget.select();
7414
7459
  },
7415
- className: cn(otpCellVariants({ size, surface }))
7460
+ className: cn(otpCellVariants({ size, surface, fluid }))
7416
7461
  },
7417
7462
  inputId
7418
7463
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olundot/ui",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "OLUN. shared React UI components built on OLUN design tokens",
5
5
  "license": "MIT",
6
6
  "keywords": [