@carbon/utilities 0.11.0-rc.0 → 0.12.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.
@@ -0,0 +1 @@
1
+ const a=new Map;function s(t){const e=a.get(t);if(e)return e;const n=new Intl.DateTimeFormat(t,{year:"numeric",month:"long"}).formatToParts(new Date(2e3,0,1)),d=n.findIndex(r=>r.type==="month"),h=n.findIndex(r=>r.type==="year"),o=d<h?"month-year":"year-month";return a.set(t,o),o}const m=t=>s(t)==="month-year",c={getMonthYearOrder:s,isMonthFirst:m};export{c as datePartsOrder};
@@ -0,0 +1 @@
1
+ export*from"./datePartsOrder";
package/es/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./dateTimeFormat";export*from"./overflowHandler";export*from"@internationalized/number";export*from"./documentLang";export*from"./carousel";
1
+ export*from"@internationalized/number";export*from"./carousel";export*from"./datePartsOrder";export*from"./dateTimeFormat";export*from"./documentLang";export*from"./overflowHandler";
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var g=(t,r)=>{for(var e in r)s(t,e,{get:r[e],enumerable:!0})},p=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of i(r))!y.call(t,n)&&n!==e&&s(t,n,{get:()=>r[n],enumerable:!(o=c(r,n))||o.enumerable});return t};var O=t=>p(s({},"__esModule",{value:!0}),t);var I={};g(I,{datePartsOrder:()=>x});module.exports=O(I);const h=new Map;function m(t){const r=h.get(t);if(r)return r;const e=new Intl.DateTimeFormat(t,{year:"numeric",month:"long"}).formatToParts(new Date(2e3,0,1)),o=e.findIndex(a=>a.type==="month"),n=e.findIndex(a=>a.type==="year"),d=o<n?"month-year":"year-month";return h.set(t,d),d}const f=t=>m(t)==="month-year",x={getMonthYearOrder:m,isMonthFirst:f};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./datePartsOrder"),module.exports);
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var f=(t,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of a(e))!b.call(t,m)&&m!==p&&n(t,m,{get:()=>e[m],enumerable:!(x=i(e,m))||x.enumerable});return t},o=(t,e,p)=>(f(t,e,"default"),p&&f(p,e,"default"));var d=t=>f(n({},"__esModule",{value:!0}),t);var r={};module.exports=d(r);o(r,require("./dateTimeFormat"),module.exports);o(r,require("./overflowHandler"),module.exports);o(r,require("@internationalized/number"),module.exports);o(r,require("./documentLang"),module.exports);o(r,require("./carousel"),module.exports);
1
+ "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var f=(t,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of a(e))!b.call(t,m)&&m!==p&&n(t,m,{get:()=>e[m],enumerable:!(x=i(e,m))||x.enumerable});return t},o=(t,e,p)=>(f(t,e,"default"),p&&f(p,e,"default"));var d=t=>f(n({},"__esModule",{value:!0}),t);var r={};module.exports=d(r);o(r,require("@internationalized/number"),module.exports);o(r,require("./carousel"),module.exports);o(r,require("./datePartsOrder"),module.exports);o(r,require("./dateTimeFormat"),module.exports);o(r,require("./documentLang"),module.exports);o(r,require("./overflowHandler"),module.exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/utilities",
3
3
  "description": "Utilities and helpers to drive consistency across software products using the Carbon Design System",
4
- "version": "0.11.0-rc.0",
4
+ "version": "0.12.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -41,11 +41,11 @@
41
41
  "esbuild": "^0.25.0",
42
42
  "rimraf": "^6.0.1",
43
43
  "typescript": "^5.7.3",
44
- "typescript-config-carbon": "^0.8.0-rc.0"
44
+ "typescript-config-carbon": "^0.8.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@ibm/telemetry-js": "^1.6.1",
48
48
  "@internationalized/number": "^3.6.1"
49
49
  },
50
- "gitHead": "0d9497f77c917c567c8be19157e3da42d7a02c04"
50
+ "gitHead": "44f7fd230585f66d32c839d1c11d2992d5929294"
51
51
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ type Order = 'month-year' | 'year-month';
8
+ declare function getMonthYearOrder(locale: string): Order;
9
+ export declare const datePartsOrder: {
10
+ getMonthYearOrder: typeof getMonthYearOrder;
11
+ isMonthFirst: (locale: string) => boolean;
12
+ };
13
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export * from './datePartsOrder';
package/types/index.d.ts CHANGED
@@ -4,9 +4,10 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- export * from './dateTimeFormat';
8
- export * from './overflowHandler';
9
7
  export * from '@internationalized/number';
10
8
  export type * from '@internationalized/number';
11
- export * from './documentLang';
12
9
  export * from './carousel';
10
+ export * from './datePartsOrder';
11
+ export * from './dateTimeFormat';
12
+ export * from './documentLang';
13
+ export * from './overflowHandler';