@crystallize/design-system 1.23.0 → 1.23.1

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,14 @@
1
1
  # @crystallize/design-system
2
2
 
3
+ ## 1.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 74818d2: This pr is adding a basic components and mutations to add an item to specific flow
8
+ query getFlows was moved to common hooks as it is used in different views
9
+
10
+ Also prop classname was added to Select.Container component to allow better styling
11
+
3
12
  ## 1.23.0
4
13
 
5
14
  ### Minor Changes
package/dist/index.css CHANGED
@@ -1033,11 +1033,14 @@
1033
1033
  }
1034
1034
 
1035
1035
  /* src/dialog/dialog.css */
1036
+ :root {
1037
+ --dialog-z-index: 100;
1038
+ }
1036
1039
  .c-dialog {
1037
1040
  position: fixed;
1038
1041
  left: 50%;
1039
1042
  top: 50%;
1040
- z-index: 100;
1043
+ z-index: var(--dialog-z-index);
1041
1044
  width: auto;
1042
1045
  min-width: 25%;
1043
1046
  max-width: 800px;
@@ -1059,7 +1062,7 @@
1059
1062
  .c-dialog-overlay {
1060
1063
  position: fixed;
1061
1064
  inset: 0px;
1062
- z-index: 100;
1065
+ z-index: var(--dialog-z-index);
1063
1066
  background-color: rgb(var(--c-color-overlay) / 0.3);
1064
1067
  }
1065
1068
  .c-dialog-icon-wrapper {
@@ -1619,6 +1622,9 @@
1619
1622
  outline: 2px solid transparent;
1620
1623
  outline-offset: 2px;
1621
1624
  }
1625
+ .c-dialog ~ div > .c-select-content {
1626
+ z-index: calc(var(--dialog-z-index) + 1);
1627
+ }
1622
1628
 
1623
1629
  /* src/slider/slider.css */
1624
1630
  .c-slider-root {
package/dist/index.d.ts CHANGED
@@ -286,6 +286,7 @@ declare const Select: {
286
286
  } & class_variance_authority.VariantProps<(props?: ({
287
287
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
288
288
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string> & {
289
+ triggerClassName?: string | undefined;
289
290
  disabled?: boolean | undefined;
290
291
  id?: string | undefined;
291
292
  placeholder?: string | undefined;
package/dist/index.js CHANGED
@@ -39536,13 +39536,13 @@ var selectTriggerStyles = (0, import_class_variance_authority17.cva)("c-select-t
39536
39536
  }
39537
39537
  });
39538
39538
  var SelectContainer = (0, import_react111.forwardRef)(
39539
- ({ children, id, placeholder, disabled, size, ...delegated }, ref) => {
39539
+ ({ children, id, placeholder, disabled, size, triggerClassName, ...delegated }, ref) => {
39540
39540
  return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(SelectPrimitives2.Root, {
39541
39541
  ...delegated,
39542
39542
  children: [
39543
39543
  /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(SelectPrimitives2.Trigger, {
39544
39544
  ref,
39545
- className: selectTriggerStyles({ size }),
39545
+ className: selectTriggerStyles({ size, className: triggerClassName }),
39546
39546
  disabled,
39547
39547
  id,
39548
39548
  children: [
package/dist/index.mjs CHANGED
@@ -224,13 +224,13 @@ var selectTriggerStyles = cva4("c-select-trigger", {
224
224
  }
225
225
  });
226
226
  var SelectContainer = forwardRef4(
227
- ({ children, id, placeholder, disabled, size, ...delegated }, ref) => {
227
+ ({ children, id, placeholder, disabled, size, triggerClassName, ...delegated }, ref) => {
228
228
  return /* @__PURE__ */ jsxs3(SelectPrimitives2.Root, {
229
229
  ...delegated,
230
230
  children: [
231
231
  /* @__PURE__ */ jsxs3(SelectPrimitives2.Trigger, {
232
232
  ref,
233
- className: selectTriggerStyles({ size }),
233
+ className: selectTriggerStyles({ size, className: triggerClassName }),
234
234
  disabled,
235
235
  id,
236
236
  children: [
@@ -1582,11 +1582,14 @@
1582
1582
  }
1583
1583
 
1584
1584
  /* src/dialog/dialog.css */
1585
+ :root {
1586
+ --dialog-z-index: 100;
1587
+ }
1585
1588
  .c-dialog {
1586
1589
  position: fixed;
1587
1590
  left: 50%;
1588
1591
  top: 50%;
1589
- z-index: 100;
1592
+ z-index: var(--dialog-z-index);
1590
1593
  width: auto;
1591
1594
  min-width: 25%;
1592
1595
  max-width: 800px;
@@ -1608,7 +1611,7 @@
1608
1611
  .c-dialog-overlay {
1609
1612
  position: fixed;
1610
1613
  inset: 0px;
1611
- z-index: 100;
1614
+ z-index: var(--dialog-z-index);
1612
1615
  background-color: rgb(var(--c-color-overlay) / 0.3);
1613
1616
  }
1614
1617
  .c-dialog-icon-wrapper {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystallize/design-system",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,9 +1,18 @@
1
+ :root {
2
+ --dialog-z-index: 100;
3
+ }
4
+
1
5
  .c-dialog {
2
- @apply fixed left-1/2 top-1/2 z-[100] w-auto min-w-[25%] max-w-[800px] rounded-lg bg-elevate p-14 leading-6 text-gray-500-400 shadow;
6
+ @apply fixed
7
+ left-1/2 top-1/2
8
+ z-[--dialog-z-index]
9
+ w-auto min-w-[25%] max-w-[800px] rounded-lg bg-elevate p-14 leading-6 text-gray-500-400 shadow;
3
10
  transform: translate(-50%, -50%);
4
11
 
5
12
  &-overlay {
6
- @apply fixed inset-0 z-[100] bg-overlay;
13
+ @apply fixed
14
+ inset-0 z-[--dialog-z-index]
15
+ bg-overlay;
7
16
  }
8
17
 
9
18
  &-icon-wrapper {
@@ -21,16 +21,22 @@ const selectTriggerStyles = cva('c-select-trigger', {
21
21
  export type SelectRef = HTMLButtonElement;
22
22
  export type SelectProps = ComponentProps<typeof SelectPrimitives.Root> &
23
23
  VariantProps<typeof selectTriggerStyles> & {
24
+ triggerClassName?: string;
24
25
  disabled?: boolean;
25
26
  id?: string;
26
27
  placeholder?: string;
27
28
  };
28
29
 
29
30
  export const SelectContainer = forwardRef<SelectRef, SelectProps>(
30
- ({ children, id, placeholder, disabled, size, ...delegated }, ref) => {
31
+ ({ children, id, placeholder, disabled, size, triggerClassName, ...delegated }, ref) => {
31
32
  return (
32
33
  <SelectPrimitives.Root {...delegated}>
33
- <SelectPrimitives.Trigger ref={ref} className={selectTriggerStyles({ size })} disabled={disabled} id={id}>
34
+ <SelectPrimitives.Trigger
35
+ ref={ref}
36
+ className={selectTriggerStyles({ size, className: triggerClassName })}
37
+ disabled={disabled}
38
+ id={id}
39
+ >
34
40
  <SelectPrimitives.Value placeholder={<span className="c-select-value">{placeholder ?? 'Select...'}</span>} />
35
41
  <Icon.Arrow />
36
42
  </SelectPrimitives.Trigger>
@@ -43,3 +43,9 @@
43
43
  @apply bg-gray-50-900 outline-none;
44
44
  }
45
45
  }
46
+
47
+ /*This is a workaround to handle z-index on dialog component that is also rendered in portal on the same level*/
48
+ /*Styles added to .c-dialog are added to parent div as inline styles, therefore ~ div > .c-select-content*/
49
+ .c-dialog ~ div > .c-select-content {
50
+ z-index: calc(var(--dialog-z-index) + 1);
51
+ }