@harnessio/ui 0.5.39 → 0.5.40

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.
@@ -1,11 +1,11 @@
1
- import { I as f, Z as h, h as E, e as T, c as k, i as _, d as A, j as g, k as P, f as q, g as y, a as D, b as O, l as L, s as N } from "./utils-FHJmIMTH.js";
2
- import { c as v, z as x, L as M, k as F, r as R, A as j, B as z, C as Z, D as S, s as B, E as $, F as G, x as H, G as U, l as V, v as W, H as X, n as J, j as K, i as Q, y as Y, I as ee, J as ae, u as te, o as se, w as re } from "./textarea-utils-BABZsh7u.js";
3
- import { z as ne } from "./index-yGuTXfMI.js";
4
- function oe(e) {
5
- return v(e, Date.now());
1
+ import { I as w, Z as C, h as b, e as f, c as _, i as k, d as A, j as g, k as P, f as q, g as D, a as y, b as L, l as M, s as N } from "./utils-FHJmIMTH.js";
2
+ import { c as O, A as v, L as x, T as F, k as R, s as S, B as j, C as z, D as Z, E as H, v as B, F as G, G as $, y as U, H as V, l as K, x as W, I as X, n as J, j as Q, p as Y, i as ee, z as ae, J as te, K as se, u as re, o as ne, w as oe } from "./textarea-utils-CquwOLUe.js";
3
+ import { z as ie } from "./index-yGuTXfMI.js";
4
+ function le(e) {
5
+ return O(e, Date.now());
6
6
  }
7
- function ie(e, a) {
8
- return x(e, oe(e), a);
7
+ function ce(e, a) {
8
+ return v(e, le(e), a);
9
9
  }
10
10
  const d = /^[a-zA-Z_][0-9a-zA-Z_]*$/, p = /^[a-zA-Z_][0-9a-zA-Z_-]*$/, m = [
11
11
  "or",
@@ -33,23 +33,23 @@ const d = /^[a-zA-Z_][0-9a-zA-Z_]*$/, p = /^[a-zA-Z_][0-9a-zA-Z_-]*$/, m = [
33
33
  "account",
34
34
  "class",
35
35
  "shellScriptProvisioner"
36
- ], le = (e) => ne.string().regex(
36
+ ], me = (e) => ie.string().regex(
37
37
  e != null && e.allowHyphen ? p : d,
38
38
  e != null && e.regexErrorMsg ? e == null ? void 0 : e.regexErrorMsg : "Identifier can only contain alphanumerics, _ and $"
39
39
  ).min(1, e != null && e.requiredErrorMsg ? e == null ? void 0 : e.requiredErrorMsg : "Identifier is required").refine((a) => !m.includes(a), {
40
40
  message: `Identifier must not be one of the following values: ${m.join(", ")}`
41
41
  });
42
42
  function I(e = "requestAnimationFrame", a) {
43
- const t = [], C = e === "requestAnimationFrame" ? requestAnimationFrame : window.requestIdleCallback;
43
+ const t = [], T = e === "requestAnimationFrame" ? requestAnimationFrame : window.requestIdleCallback;
44
44
  let o = 1, c = !1;
45
- const b = (r, s = t.length) => (o = o + 1 < Number.MAX_SAFE_INTEGER ? o + 1 : 1, t.splice(s, 0, [r, o]), u(), o), u = () => {
45
+ const h = (r, s = t.length) => (o = o + 1 < Number.MAX_SAFE_INTEGER ? o + 1 : 1, t.splice(s, 0, [r, o]), u(), o), u = () => {
46
46
  if (!c && t.length) {
47
47
  c = !0;
48
48
  const r = t.splice(0, a), s = r.map((n) => {
49
- let i = ce;
49
+ let i = ue;
50
50
  return new Promise((l) => i = l), { resolve: i };
51
51
  });
52
- r.forEach((n, i) => C(() => {
52
+ r.forEach((n, i) => T(() => {
53
53
  var l;
54
54
  return s[i].resolve((l = n[0]) == null ? void 0 : l.call(n));
55
55
  })), Promise.all(s).then(() => {
@@ -57,12 +57,12 @@ function I(e = "requestAnimationFrame", a) {
57
57
  });
58
58
  }
59
59
  };
60
- return { scheduleTask: b, cancelTask: (r) => {
60
+ return { scheduleTask: h, cancelTask: (r) => {
61
61
  const s = t.findIndex(([, n]) => n === r);
62
62
  s > -1 && t.splice(s, 1);
63
63
  } };
64
64
  }
65
- const w = 10, ce = () => 0, me = (e = w) => I("requestAnimationFrame", e), ue = (e = w) => I("requestIdleCallback", e);
65
+ const E = 10, ue = () => 0, de = (e = E) => I("requestAnimationFrame", e), pe = (e = E) => I("requestIdleCallback", e);
66
66
  window.requestIdleCallback = window.requestIdleCallback || function(e) {
67
67
  const a = Date.now();
68
68
  return setTimeout(function() {
@@ -77,63 +77,65 @@ window.requestIdleCallback = window.requestIdleCallback || function(e) {
77
77
  window.cancelIdleCallback = window.cancelIdleCallback || function(e) {
78
78
  clearTimeout(e);
79
79
  };
80
- const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
80
+ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
81
81
  __proto__: null,
82
- INITIAL_ZOOM_LEVEL: f,
83
- LOCALE: M,
84
- ZOOM_INC_DEC_LEVEL: h,
85
- afterFrames: F,
86
- buildPaginationLink: E,
87
- clamp: T,
88
- cn: k,
89
- createPaginationLinks: _,
90
- createRequestAnimationFrameTaskPool: me,
91
- createRequestIdleCallbackTaskPool: ue,
92
- csvToObject: R,
82
+ INITIAL_ZOOM_LEVEL: w,
83
+ LOCALE: x,
84
+ TRIMMED_SHA_LENGTH: F,
85
+ ZOOM_INC_DEC_LEVEL: C,
86
+ afterFrames: R,
87
+ buildPaginationLink: b,
88
+ clamp: f,
89
+ cn: _,
90
+ createPaginationLinks: k,
91
+ createRequestAnimationFrameTaskPool: de,
92
+ createRequestIdleCallbackTaskPool: pe,
93
+ csvToObject: S,
93
94
  decodeURIComponentIfValid: A,
94
95
  decodeURIPath: g,
95
96
  easyPluralize: j,
96
97
  encodePath: P,
97
98
  filterChildrenByDisplayNames: q,
98
99
  formatDate: z,
99
- formatDistanceToNow: ie,
100
+ formatDistanceToNow: ce,
100
101
  formatDuration: Z,
101
- formatNumber: S,
102
+ formatNumber: H,
102
103
  formatRelativeTime: B,
103
- formatTime: $,
104
- formatTimestamp: G,
105
- generateAlphaNumericHash: y,
106
- getCaretCoordinates: H,
107
- getCaretPosition: U,
108
- getComponentDisplayName: V,
109
- getCssNumber: D,
104
+ formatTime: G,
105
+ formatTimestamp: $,
106
+ generateAlphaNumericHash: D,
107
+ getCaretCoordinates: U,
108
+ getCaretPosition: V,
109
+ getComponentDisplayName: K,
110
+ getCssNumber: y,
110
111
  getCurrentWord: W,
111
- getErrorMessage: O,
112
+ getErrorMessage: L,
112
113
  getFormattedDuration: X,
113
114
  getInitials: J,
114
- getShadowActiveElement: K,
115
+ getShadowActiveElement: Q,
116
+ getTrimmedSha: Y,
115
117
  hyphenRegexIdentifier: p,
116
- identifierSchema: le,
118
+ identifierSchema: me,
117
119
  illegalIdentifiers: m,
118
- isAnyTypeOf: Q,
119
- isPromise: L,
120
+ isAnyTypeOf: ee,
121
+ isPromise: M,
120
122
  regexIdentifier: d,
121
- replaceWord: Y,
123
+ replaceWord: ae,
122
124
  settingsBackLink: N,
123
- splitObjectProps: ee,
124
- timeDistance: ae,
125
- useMergeRefs: te,
126
- wrapConditionalArrayElements: se,
127
- wrapConditionalObjectElement: re
125
+ splitObjectProps: te,
126
+ timeDistance: se,
127
+ useMergeRefs: re,
128
+ wrapConditionalArrayElements: ne,
129
+ wrapConditionalObjectElement: oe
128
130
  }, Symbol.toStringTag, { value: "Module" }));
129
131
  export {
130
132
  m as a,
131
- le as b,
132
- me as c,
133
- ue as d,
134
- ie as f,
133
+ me as b,
134
+ de as c,
135
+ pe as d,
136
+ ce as f,
135
137
  p as h,
136
- Ce as i,
138
+ we as i,
137
139
  d as r
138
140
  };
139
- //# sourceMappingURL=index-TEMkwCmP.js.map
141
+ //# sourceMappingURL=index-F1mc0sEF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-TEMkwCmP.js","sources":["../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructNow.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistanceToNow.mjs","../src/utils/schema.ts","../src/utils/task.ts"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","import { z } from 'zod'\n\n// Assuming these are defined elsewhere by the user\nexport const regexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_]*$/\n\nexport const hyphenRegexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_-]*$/\n\nexport const illegalIdentifiers = [\n 'or',\n 'and',\n 'eq',\n 'ne',\n 'lt',\n 'gt',\n 'le',\n 'ge',\n 'div',\n 'mod',\n 'not',\n 'null',\n 'true',\n 'false',\n 'new',\n 'var',\n 'return',\n 'step',\n 'parallel',\n 'stepGroup',\n 'insert',\n 'org',\n 'account',\n 'class',\n 'shellScriptProvisioner'\n]\n\nexport const identifierSchema = (config?: {\n allowHyphen?: boolean\n regexErrorMsg?: string\n requiredErrorMsg?: string\n}) =>\n z\n .string()\n .regex(\n config?.allowHyphen ? hyphenRegexIdentifier : regexIdentifier,\n config?.regexErrorMsg ? config?.regexErrorMsg : 'Identifier can only contain alphanumerics, _ and $'\n )\n .min(1, config?.requiredErrorMsg ? config?.requiredErrorMsg : 'Identifier is required')\n .refine(val => !illegalIdentifiers.includes(val), {\n message: `Identifier must not be one of the following values: ${illegalIdentifiers.join(', ')}`\n })\n","type Task = () => void\ntype RunnerType = 'requestAnimationFrame' | 'requestIdleCallback' | 'setTimeout'\n\nfunction createTaskPool(type: RunnerType = 'requestAnimationFrame', blockSize: number) {\n const tasks: Array<[Task, number]> = []\n const runner = type === 'requestAnimationFrame' ? requestAnimationFrame : window.requestIdleCallback\n\n let id = 1\n let running = false\n\n const scheduleTask = (task: Task, priority = tasks.length) => {\n id = id + 1 < Number.MAX_SAFE_INTEGER ? id + 1 : 1\n tasks.splice(priority, 0, [task, id])\n run()\n return id\n }\n\n const run = () => {\n if (!running && tasks.length) {\n running = true\n\n const block = tasks.splice(0, blockSize)\n\n const blockTracking = block.map(_ => {\n let resolve: (value: unknown) => void = noop\n new Promise(_resolve => (resolve = _resolve))\n return { resolve }\n })\n\n block.forEach((task, idx) => runner(() => blockTracking[idx].resolve(task[0]?.())))\n\n Promise.all(blockTracking).then(() => {\n running = false\n if (tasks.length) run()\n })\n }\n }\n\n const cancelTask = (taskId: number) => {\n const index = tasks.findIndex(([, _id]) => _id === taskId)\n if (index > -1) tasks.splice(index, 1)\n }\n\n return { scheduleTask, cancelTask }\n}\n\nconst EXECUTION_BLOCK_SIZE = 10\nconst noop = () => 0\n\nexport const createRequestAnimationFrameTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestAnimationFrame', blockSize)\nexport const createRequestIdleCallbackTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestIdleCallback', blockSize)\n\n// Polly fill requestIdleCallback/cancelIdleCallback for Safari\nwindow.requestIdleCallback =\n window.requestIdleCallback ||\n function (cb) {\n const start = Date.now()\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n }\n })\n }, 1)\n }\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function (id) {\n clearTimeout(id)\n }\n"],"names":["constructNow","date","constructFrom","formatDistanceToNow","options","formatDistance","regexIdentifier","hyphenRegexIdentifier","illegalIdentifiers","identifierSchema","config","z","val","createTaskPool","type","blockSize","tasks","runner","id","running","scheduleTask","task","priority","run","block","blockTracking","_","resolve","noop","_resolve","idx","_a","taskId","index","_id","EXECUTION_BLOCK_SIZE","createRequestAnimationFrameTaskPool","createRequestIdleCallbackTaskPool","cb","start"],"mappings":";;;AAgCO,SAASA,GAAaC,GAAM;AACjC,SAAOC,EAAcD,GAAM,KAAK,IAAG,CAAE;AACvC;ACwDO,SAASE,GAAoBF,GAAMG,GAAS;AACjD,SAAOC,EAAeJ,GAAMD,GAAaC,CAAI,GAAGG,CAAO;AACzD;ACzFO,MAAME,IAAkB,4BAElBC,IAAwB,6BAExBC,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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,GAElF,QAAQ,IAAII,CAAa,EAAE,KAAK,MAAM;AAC1B,QAAAN,IAAA,IACNH,EAAM,UAAYO,EAAA;AAAA,MAAA,CACvB;AAAA,IAAA;AAAA,EAEL;AAOO,SAAA,EAAE,cAAAH,GAAc,YALJ,CAACY,MAAmB;AAC/B,UAAAC,IAAQjB,EAAM,UAAU,CAAC,CAAA,EAAGkB,CAAG,MAAMA,MAAQF,CAAM;AACzD,IAAIC,IAAQ,MAAUjB,EAAA,OAAOiB,GAAO,CAAC;AAAA,EACvC,EAEkC;AACpC;AAEA,MAAME,IAAuB,IACvBP,KAAO,MAAM,GAENQ,KAAsC,CAACrB,IAAYoB,MAC9DtB,EAAe,yBAAyBE,CAAS,GACtCsB,KAAoC,CAACtB,IAAYoB,MAC5DtB,EAAe,uBAAuBE,CAAS;AAGjD,OAAO,sBACL,OAAO,uBACP,SAAUuB,GAAI;AACN,QAAAC,IAAQ,KAAK,IAAI;AACvB,SAAO,WAAW,WAAY;AACzB,IAAAD,EAAA;AAAA,MACD,YAAY;AAAA,MACZ,eAAe,WAAY;AACzB,eAAO,KAAK,IAAI,GAAG,MAAM,KAAK,IAAA,IAAQC,EAAM;AAAA,MAAA;AAAA,IAC9C,CACD;AAAA,KACA,CAAC;AACN;AAEF,OAAO,qBACL,OAAO,sBACP,SAAUrB,GAAI;AACZ,eAAaA,CAAE;AACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"index-F1mc0sEF.js","sources":["../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructNow.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistanceToNow.mjs","../src/utils/schema.ts","../src/utils/task.ts"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","import { z } from 'zod'\n\n// Assuming these are defined elsewhere by the user\nexport const regexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_]*$/\n\nexport const hyphenRegexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_-]*$/\n\nexport const illegalIdentifiers = [\n 'or',\n 'and',\n 'eq',\n 'ne',\n 'lt',\n 'gt',\n 'le',\n 'ge',\n 'div',\n 'mod',\n 'not',\n 'null',\n 'true',\n 'false',\n 'new',\n 'var',\n 'return',\n 'step',\n 'parallel',\n 'stepGroup',\n 'insert',\n 'org',\n 'account',\n 'class',\n 'shellScriptProvisioner'\n]\n\nexport const identifierSchema = (config?: {\n allowHyphen?: boolean\n regexErrorMsg?: string\n requiredErrorMsg?: string\n}) =>\n z\n .string()\n .regex(\n config?.allowHyphen ? hyphenRegexIdentifier : regexIdentifier,\n config?.regexErrorMsg ? config?.regexErrorMsg : 'Identifier can only contain alphanumerics, _ and $'\n )\n .min(1, config?.requiredErrorMsg ? config?.requiredErrorMsg : 'Identifier is required')\n .refine(val => !illegalIdentifiers.includes(val), {\n message: `Identifier must not be one of the following values: ${illegalIdentifiers.join(', ')}`\n })\n","type Task = () => void\ntype RunnerType = 'requestAnimationFrame' | 'requestIdleCallback' | 'setTimeout'\n\nfunction createTaskPool(type: RunnerType = 'requestAnimationFrame', blockSize: number) {\n const tasks: Array<[Task, number]> = []\n const runner = type === 'requestAnimationFrame' ? requestAnimationFrame : window.requestIdleCallback\n\n let id = 1\n let running = false\n\n const scheduleTask = (task: Task, priority = tasks.length) => {\n id = id + 1 < Number.MAX_SAFE_INTEGER ? id + 1 : 1\n tasks.splice(priority, 0, [task, id])\n run()\n return id\n }\n\n const run = () => {\n if (!running && tasks.length) {\n running = true\n\n const block = tasks.splice(0, blockSize)\n\n const blockTracking = block.map(_ => {\n let resolve: (value: unknown) => void = noop\n new Promise(_resolve => (resolve = _resolve))\n return { resolve }\n })\n\n block.forEach((task, idx) => runner(() => blockTracking[idx].resolve(task[0]?.())))\n\n Promise.all(blockTracking).then(() => {\n running = false\n if (tasks.length) run()\n })\n }\n }\n\n const cancelTask = (taskId: number) => {\n const index = tasks.findIndex(([, _id]) => _id === taskId)\n if (index > -1) tasks.splice(index, 1)\n }\n\n return { scheduleTask, cancelTask }\n}\n\nconst EXECUTION_BLOCK_SIZE = 10\nconst noop = () => 0\n\nexport const createRequestAnimationFrameTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestAnimationFrame', blockSize)\nexport const createRequestIdleCallbackTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestIdleCallback', blockSize)\n\n// Polly fill requestIdleCallback/cancelIdleCallback for Safari\nwindow.requestIdleCallback =\n window.requestIdleCallback ||\n function (cb) {\n const start = Date.now()\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n }\n })\n }, 1)\n }\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function (id) {\n clearTimeout(id)\n }\n"],"names":["constructNow","date","constructFrom","formatDistanceToNow","options","formatDistance","regexIdentifier","hyphenRegexIdentifier","illegalIdentifiers","identifierSchema","config","z","val","createTaskPool","type","blockSize","tasks","runner","id","running","scheduleTask","task","priority","run","block","blockTracking","_","resolve","noop","_resolve","idx","_a","taskId","index","_id","EXECUTION_BLOCK_SIZE","createRequestAnimationFrameTaskPool","createRequestIdleCallbackTaskPool","cb","start"],"mappings":";;;AAgCO,SAASA,GAAaC,GAAM;AACjC,SAAOC,EAAcD,GAAM,KAAK,IAAG,CAAE;AACvC;ACwDO,SAASE,GAAoBF,GAAMG,GAAS;AACjD,SAAOC,EAAeJ,GAAMD,GAAaC,CAAI,GAAGG,CAAO;AACzD;ACzFO,MAAME,IAAkB,4BAElBC,IAAwB,6BAExBC,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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AAAQ,EAAcK,CAAG,EAAE,SAAQC,IAAAV,EAAK,OAAL,gBAAAU,EAAA,KAAAV,EAAW;AAAA,OAAC,CAAC,GAElF,QAAQ,IAAII,CAAa,EAAE,KAAK,MAAM;AAC1B,QAAAN,IAAA,IACNH,EAAM,UAAYO,EAAA;AAAA,MAAA,CACvB;AAAA,IAAA;AAAA,EAEL;AAOO,SAAA,EAAE,cAAAH,GAAc,YALJ,CAACY,MAAmB;AAC/B,UAAAC,IAAQjB,EAAM,UAAU,CAAC,CAAA,EAAGkB,CAAG,MAAMA,MAAQF,CAAM;AACzD,IAAIC,IAAQ,MAAUjB,EAAA,OAAOiB,GAAO,CAAC;AAAA,EACvC,EAEkC;AACpC;AAEA,MAAME,IAAuB,IACvBP,KAAO,MAAM,GAENQ,KAAsC,CAACrB,IAAYoB,MAC9DtB,EAAe,yBAAyBE,CAAS,GACtCsB,KAAoC,CAACtB,IAAYoB,MAC5DtB,EAAe,uBAAuBE,CAAS;AAGjD,OAAO,sBACL,OAAO,uBACP,SAAUuB,GAAI;AACN,QAAAC,IAAQ,KAAK,IAAI;AACvB,SAAO,WAAW,WAAY;AACzB,IAAAD,EAAA;AAAA,MACD,YAAY;AAAA,MACZ,eAAe,WAAY;AACzB,eAAO,KAAK,IAAI,GAAG,MAAM,KAAK,IAAA,IAAQC,EAAM;AAAA,MAAA;AAAA,IAC9C,CACD;AAAA,KACA,CAAC;AACN;AAEF,OAAO,qBACL,OAAO,sBACP,SAAUrB,GAAI;AACZ,eAAaA,CAAE;AACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
package/dist/index.d.ts CHANGED
@@ -2065,13 +2065,14 @@ declare function dispatchCustomEvent<T>(name: string, detail: T): void;
2065
2065
 
2066
2066
  declare const DraggableCard: ({ id, title, description, disableDragAndDrop, gripPosition, className, ...cardProps }: DraggableCardProps) => JSX_2.Element;
2067
2067
 
2068
- declare const DraggableCardList: ({ cards, setCards, listGap, className, header, sticky }: {
2068
+ declare const DraggableCardList: ({ cards, setCards, listGap, className, header, sticky, contained }: {
2069
2069
  cards: CardData[];
2070
2070
  setCards: (newCards: CardData[]) => void;
2071
2071
  listGap?: GapSize;
2072
2072
  className?: string;
2073
2073
  header?: React.ReactNode;
2074
2074
  sticky?: boolean;
2075
+ contained?: boolean;
2075
2076
  }) => JSX_2.Element;
2076
2077
 
2077
2078
  declare interface DraggableCardProps extends Omit<CardRootProps, 'title' | 'children'> {
@@ -2905,6 +2906,12 @@ declare const getT: (translator: TFunction) => {
2905
2906
  */
2906
2907
  declare function getThemeCSSName(theme: FullTheme): string | null;
2907
2908
 
2909
+ /**
2910
+ * Trim a git commit SHA to the standardised short-SHA display length.
2911
+ * Safely handles `undefined` and SHAs shorter than the limit (returned unchanged).
2912
+ */
2913
+ declare const getTrimmedSha: (sha?: string) => string;
2914
+
2908
2915
  declare const GitCommitDialog: FC<GitCommitDialogProps>;
2909
2916
 
2910
2917
  declare interface GitCommitDialogProps {
@@ -4443,6 +4450,7 @@ declare interface MultiSelectProps extends CommonInputsProp {
4443
4450
  commandProps?: ComponentPropsWithoutRef<typeof Command.Root>;
4444
4451
  /** Props of `CommandInput` */
4445
4452
  inputProps?: Omit<ComponentPropsWithoutRef<typeof Command_2.Input>, 'value' | 'placeholder' | 'disabled'>;
4453
+ prefix?: ReactNode;
4446
4454
  }
4447
4455
 
4448
4456
  declare interface MultiSelectRef {
@@ -6599,6 +6607,7 @@ declare interface StickyListSectionHeaderProps extends HTMLAttributes<HTMLDivEle
6599
6607
  declare interface StickyListSectionRootProps extends HTMLAttributes<HTMLDivElement> {
6600
6608
  children: ReactNode;
6601
6609
  className?: string;
6610
+ contained?: boolean;
6602
6611
  }
6603
6612
 
6604
6613
  declare const StudioCard: {
@@ -7353,6 +7362,8 @@ asChild?: boolean;
7353
7362
 
7354
7363
  declare type TriggerType = 'click' | 'hover';
7355
7364
 
7365
+ declare const TRIMMED_SHA_LENGTH = 6;
7366
+
7356
7367
  /**
7357
7368
  * Creates a union type from an array of JavaScript type names
7358
7369
  */
@@ -7934,6 +7945,8 @@ declare namespace utils {
7934
7945
  decodeURIPath,
7935
7946
  settingsBackLink,
7936
7947
  getCssNumber,
7948
+ TRIMMED_SHA_LENGTH,
7949
+ getTrimmedSha,
7937
7950
  getInitials,
7938
7951
  csvToObject,
7939
7952
  easyPluralize,
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { i as s } from "./index-Bvr23CG5.js";
2
- import { i as e } from "./index-DLQPv1ZO.js";
2
+ import { i as e } from "./index-D0SEOfHL.js";
3
3
  import { i as a } from "./index-DOfoODGt.js";
4
4
  import { i as m } from "./index-CnTWfvOd.js";
5
5
  import { i as f } from "./index-yGuTXfMI.js";
6
- import { i as l } from "./index-TEMkwCmP.js";
6
+ import { i as l } from "./index-F1mc0sEF.js";
7
7
  export {
8
8
  e as components,
9
9
  a as context,