@pandacss/studio 0.45.2 → 0.46.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/studio.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.0.2_@swc+core@1.7.6_postcss@8.4.41_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.0.2_@swc+core@1.7.6_@swc+helpers@0.4.36__postcss@8.4.45_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
2
2
  import { fileURLToPath } from "url";
3
3
  import path from "path";
4
4
  var getFilename = () => fileURLToPath(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.45.2",
3
+ "version": "0.46.0",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -48,12 +48,12 @@
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
50
  "vite": "5.4.0",
51
- "@pandacss/config": "0.45.2",
52
- "@pandacss/logger": "0.45.2",
53
- "@pandacss/shared": "0.45.2",
54
- "@pandacss/token-dictionary": "0.45.2",
55
- "@pandacss/types": "0.45.2",
56
- "@pandacss/astro-plugin-studio": "0.45.2"
51
+ "@pandacss/config": "0.46.0",
52
+ "@pandacss/logger": "0.46.0",
53
+ "@pandacss/shared": "0.46.0",
54
+ "@pandacss/token-dictionary": "0.46.0",
55
+ "@pandacss/types": "0.46.0",
56
+ "@pandacss/astro-plugin-studio": "0.46.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/react": "18.2.55",
@@ -3,8 +3,10 @@ import { withoutSpace } from '../helpers.mjs';
3
3
  const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base"
4
4
  const conditions = new Set(conditionsStr.split(','))
5
5
 
6
+ const conditionRegex = /^@|&|&$/
7
+
6
8
  export function isCondition(value){
7
- return conditions.has(value) || /^@|&|&$/.test(value)
9
+ return conditions.has(value) || conditionRegex.test(value)
8
10
  }
9
11
 
10
12
  const underscoreRegex = /^_/
@@ -2,6 +2,7 @@
2
2
  function isObject(value) {
3
3
  return typeof value === "object" && value != null && !Array.isArray(value);
4
4
  }
5
+ var isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
5
6
 
6
7
  // src/compact.ts
7
8
  function compact(value) {
@@ -64,8 +65,9 @@ var memo = (fn) => {
64
65
 
65
66
  // src/merge-props.ts
66
67
  function mergeProps(...sources) {
67
- const objects = sources.filter(Boolean);
68
- return objects.reduce((prev, obj) => {
68
+ return sources.reduce((prev, obj) => {
69
+ if (!obj)
70
+ return prev;
69
71
  Object.keys(obj).forEach((key) => {
70
72
  const prevValue = prev[key];
71
73
  const value = obj[key];
@@ -84,7 +86,7 @@ var isNotNullish = (element) => element != null;
84
86
  function walkObject(target, predicate, options = {}) {
85
87
  const { stop, getKey } = options;
86
88
  function inner(value, path = []) {
87
- if (isObject(value) || Array.isArray(value)) {
89
+ if (isObjectOrArray(value)) {
88
90
  const result = {};
89
91
  for (const [prop, child] of Object.entries(value)) {
90
92
  const key = getKey?.(prop, child) ?? prop;
@@ -165,9 +167,9 @@ function createCss(context) {
165
167
  const normalizedObject = normalizeStyleObject(styleObject, context);
166
168
  const classNames = /* @__PURE__ */ new Set();
167
169
  walkObject(normalizedObject, (value, paths) => {
168
- const important = isImportant(value);
169
170
  if (value == null)
170
171
  return;
172
+ const important = isImportant(value);
171
173
  const [prop, ...allConditions] = conds.shift(paths);
172
174
  const conditions = filterBaseConditions(allConditions);
173
175
  const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
@@ -278,7 +280,15 @@ function splitProps(props, ...keys) {
278
280
  }
279
281
 
280
282
  // src/uniq.ts
281
- var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
283
+ var uniq = (...items) => {
284
+ const set = items.reduce((acc, currItems) => {
285
+ if (currItems) {
286
+ currItems.forEach((item) => acc.add(item));
287
+ }
288
+ return acc;
289
+ }, /* @__PURE__ */ new Set([]));
290
+ return Array.from(set);
291
+ };
282
292
  export {
283
293
  compact,
284
294
  createCss,
@@ -19,7 +19,7 @@ export interface UtilityValues {
19
19
  float: "start" | "end" | CssProperties["float"];
20
20
  hideFrom: Tokens["breakpoints"];
21
21
  hideBelow: Tokens["breakpoints"];
22
- flexBasis: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full";
22
+ flexBasis: Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full";
23
23
  flex: "1" | "auto" | "initial" | "none";
24
24
  gridTemplateColumns: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
25
25
  gridTemplateRows: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
@@ -53,7 +53,7 @@ type DataAttributes =
53
53
  type AttributeSelector = `&${Pseudos | DataAttributes | AriaAttributes}`
54
54
  type ParentSelector = `${DataAttributes | AriaAttributes} &`
55
55
 
56
- type AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page'
56
+ type AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page' | 'scope' | 'starting-style'
57
57
 
58
58
  export type AnySelector = `${string}&` | `&${string}` | `@${AtRuleType}${string}`
59
59
  export type Selectors = AttributeSelector | ParentSelector