@isi-ui7/corporate-themes 0.2.2 → 0.2.4

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/globals.css CHANGED
@@ -174,10 +174,20 @@ body {
174
174
 
175
175
  .ui7-form-contract--density-compact {
176
176
  --ui7-form-density: compact;
177
+ --ui7-form-control-height: 2rem;
178
+ --cds-layout-size-height-sm: 2rem;
179
+ --cds-layout-size-height-md: 2rem;
180
+ --cds-layout-size-height-lg: 2rem;
181
+ --cds-layout-size-height: 2rem;
177
182
  }
178
183
 
179
184
  .ui7-form-contract--density-comfortable {
180
185
  --ui7-form-density: comfortable;
186
+ --ui7-form-control-height: 2.5rem;
187
+ --cds-layout-size-height-sm: 2.5rem;
188
+ --cds-layout-size-height-md: 2.5rem;
189
+ --cds-layout-size-height-lg: 2.5rem;
190
+ --cds-layout-size-height: 2.5rem;
181
191
  }
182
192
 
183
193
  .ui7-form-row {
@@ -8,6 +8,9 @@ export declare function useFormVisualContract(): {
8
8
  readonly scope: "ui7-form-contract";
9
9
  readonly densityCompact: "ui7-form-contract--density-compact";
10
10
  readonly densityComfortable: "ui7-form-contract--density-comfortable";
11
+ readonly widthHalf: "ui7-form-contract--width-half";
12
+ readonly widthTwoThirds: "ui7-form-contract--width-two-thirds";
13
+ readonly widthFull: "ui7-form-contract--width-full";
11
14
  readonly readonly: "ui7-form-contract--readonly";
12
15
  readonly row: "ui7-form-row";
13
16
  readonly section: "ui7-form-section";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as S } from "react/jsx-runtime";
2
- import { useContext as h, createContext as F, useMemo as k, useState as A, useEffect as C } from "react";
2
+ import { useContext as p, createContext as F, useMemo as k, useState as A, useEffect as g } from "react";
3
3
  const B = {
4
4
  brandColors: {
5
5
  primary: "#0F62FE",
@@ -70,7 +70,7 @@ const B = {
70
70
  headerBackground: "#0066CC",
71
71
  sidebarBackground: "#00A651",
72
72
  navigationBackground: "#F5F5F5"
73
- }, T = {
73
+ }, w = {
74
74
  brandColors: {
75
75
  primary: "#C8102E",
76
76
  // BJB Red (main brand color)
@@ -104,7 +104,7 @@ const B = {
104
104
  headerBackground: "#C8102E",
105
105
  sidebarBackground: "#8B0000",
106
106
  navigationBackground: "#FFF5F5"
107
- }, V = {
107
+ }, T = {
108
108
  brandColors: {
109
109
  primary: "#ED1C24",
110
110
  primaryHover: "#C61018",
@@ -135,7 +135,7 @@ const B = {
135
135
  headerBackground: "#ED1C24",
136
136
  sidebarBackground: "#FF7F00",
137
137
  navigationBackground: "#FFF4E6"
138
- }, L = {
138
+ }, V = {
139
139
  brandColors: {
140
140
  primary: "#0F62FE",
141
141
  primaryHover: "#0043CE",
@@ -166,7 +166,7 @@ const B = {
166
166
  headerBackground: "#0F62FE",
167
167
  sidebarBackground: "#1192E8",
168
168
  navigationBackground: "#F4F7FF"
169
- }, y = [
169
+ }, f = [
170
170
  {
171
171
  id: "carbon-default",
172
172
  name: "carbon-default",
@@ -179,7 +179,7 @@ const B = {
179
179
  id: "ihsan",
180
180
  name: "ihsan",
181
181
  displayName: "ISI",
182
- tokens: L,
182
+ tokens: V,
183
183
  supportedVariants: ["white", "g10", "g90", "g100"],
184
184
  defaultVariant: "g10"
185
185
  },
@@ -195,7 +195,7 @@ const B = {
195
195
  id: "bjb-syariah",
196
196
  name: "bjb-syariah",
197
197
  displayName: "BJBS",
198
- tokens: T,
198
+ tokens: w,
199
199
  supportedVariants: ["white", "g10", "g90", "g100"],
200
200
  defaultVariant: "g90"
201
201
  },
@@ -203,11 +203,11 @@ const B = {
203
203
  id: "pos-indonesia",
204
204
  name: "pos-indonesia",
205
205
  displayName: "PosInd",
206
- tokens: V,
206
+ tokens: T,
207
207
  supportedVariants: ["white", "g10", "g90", "g100"],
208
208
  defaultVariant: "g10"
209
209
  }
210
- ], b = {
210
+ ], C = {
211
211
  rowsPerPage: "Tampil",
212
212
  search: "Cari",
213
213
  noData: "Tidak ada data",
@@ -233,49 +233,52 @@ const B = {
233
233
  profile: "Profil Saya",
234
234
  changePassword: "Ganti Password",
235
235
  logout: "Keluar",
236
- searchMenuPlaceholder: "Cari menu...",
237
- searchMenuAriaLabel: "Cari menu navigasi",
236
+ searchMenuPlaceholder: "Cari navigasi...",
237
+ searchMenuAriaLabel: "Cari navigasi menu",
238
+ openSearchNavigationButtonAriaLabel: "Buka pencarian navigasi",
238
239
  clearSearchAriaLabel: "Hapus pencarian",
239
240
  removeFavoriteAriaLabel: "Hapus favorit",
240
241
  addFavoriteAriaLabel: "Tandai favorit",
242
+ favoritesTitle: "Favorit",
243
+ appSwitcherButtonAriaLabel: "Ganti aplikasi",
241
244
  profileButtonAriaLabel: "Profil pengguna",
242
245
  notificationsButtonAriaLabel: "Notifikasi",
243
246
  notificationsUnreadSuffix: "belum dibaca",
244
247
  branchLabel: "Cabang",
245
248
  viewAll: "Lihat semua"
246
- }, E = F(b);
247
- function x({
249
+ }, E = F(C);
250
+ function L({
248
251
  labels: e,
249
252
  children: a
250
253
  }) {
251
- const t = e ? { ...b, ...e } : b;
254
+ const t = e ? { ...C, ...e } : C;
252
255
  return /* @__PURE__ */ n(E.Provider, { value: t, children: a });
253
256
  }
254
- function G() {
255
- return h(E);
257
+ function z() {
258
+ return p(E);
256
259
  }
257
- const p = F(null);
258
- function P(e) {
259
- const a = y.find((t) => t.id === "carbon-default") ?? y.find((t) => t.id === "ihsan") ?? y[0];
260
- return e ? y.find((t) => t.id === e) ?? a : a;
260
+ const b = F(null);
261
+ function H(e) {
262
+ const a = f.find((t) => t.id === "carbon-default") ?? f.find((t) => t.id === "ihsan") ?? f[0];
263
+ return e ? f.find((t) => t.id === e) ?? a : a;
261
264
  }
262
- function N({ corporateId: e, variant: a, children: t }) {
263
- const r = k(() => P(e), [e]), [d, v] = A(
265
+ function x({ corporateId: e, variant: a, children: t }) {
266
+ const r = k(() => H(e), [e]), [d, v] = A(
264
267
  a ?? r.defaultVariant
265
268
  );
266
- C(() => {
269
+ g(() => {
267
270
  a && r.supportedVariants.includes(a) && v(a);
268
- }, [a, r]), C(() => {
271
+ }, [a, r]), g(() => {
269
272
  if (typeof document > "u") return;
270
273
  const m = document.documentElement, o = document.body;
271
- y.flatMap(
272
- (s) => s.supportedVariants.map((g) => `platform-theme-${s.id}-${g}`)
273
- ).forEach((s) => {
274
- m.classList.remove(s), o.classList.remove(s);
274
+ f.flatMap(
275
+ (c) => c.supportedVariants.map((h) => `platform-theme-${c.id}-${h}`)
276
+ ).forEach((c) => {
277
+ m.classList.remove(c), o.classList.remove(c);
275
278
  });
276
- const i = `platform-theme-${r.id}-${d}`;
277
- return m.classList.add(i), o.classList.add(i), () => {
278
- m.classList.remove(i), o.classList.remove(i);
279
+ const s = `platform-theme-${r.id}-${d}`;
280
+ return m.classList.add(s), o.classList.add(s), () => {
281
+ m.classList.remove(s), o.classList.remove(s);
279
282
  };
280
283
  }, [r, d]);
281
284
  const u = {
@@ -284,18 +287,18 @@ function N({ corporateId: e, variant: a, children: t }) {
284
287
  corporateId: r.id,
285
288
  setVariant: v
286
289
  };
287
- return /* @__PURE__ */ n(p.Provider, { value: u, children: t });
290
+ return /* @__PURE__ */ n(b.Provider, { value: u, children: t });
288
291
  }
289
292
  function l() {
290
- const e = h(p);
293
+ const e = p(b);
291
294
  if (!e)
292
295
  throw new Error("useTheme must be used inside ThemeProvider");
293
296
  return e;
294
297
  }
295
- function w({ corporateId: e, variant: a, children: t }) {
296
- return /* @__PURE__ */ n(N, { corporateId: e, variant: a, children: t });
298
+ function N({ corporateId: e, variant: a, children: t }) {
299
+ return /* @__PURE__ */ n(x, { corporateId: e, variant: a, children: t });
297
300
  }
298
- function z({
301
+ function K({
299
302
  as: e,
300
303
  className: a,
301
304
  corporateId: t,
@@ -304,26 +307,26 @@ function z({
304
307
  ...v
305
308
  }) {
306
309
  const u = l(), m = e ?? "div", o = k(
307
- () => t ? P(t) : u.theme,
310
+ () => t ? H(t) : u.theme,
308
311
  [t, u.theme]
309
- ), [f, i] = A(
312
+ ), [y, s] = A(
310
313
  r ?? u.variant ?? o.defaultVariant
311
314
  );
312
- C(() => {
313
- r && o.supportedVariants.includes(r) ? i(r) : r || i(o.defaultVariant);
315
+ g(() => {
316
+ r && o.supportedVariants.includes(r) ? s(r) : r || s(o.defaultVariant);
314
317
  }, [r, o]);
315
- const s = {
318
+ const c = {
316
319
  theme: o,
317
- variant: f,
320
+ variant: y,
318
321
  corporateId: o.id,
319
- setVariant: i
320
- }, g = [a, `platform-theme-${o.id}-${f}`].filter(Boolean).join(" ");
321
- return /* @__PURE__ */ n(p.Provider, { value: s, children: /* @__PURE__ */ n(m, { className: g, ...v, children: d }) });
322
+ setVariant: s
323
+ }, h = [a, `platform-theme-${o.id}-${y}`].filter(Boolean).join(" ");
324
+ return /* @__PURE__ */ n(b.Provider, { value: c, children: /* @__PURE__ */ n(m, { className: h, ...v, children: d }) });
322
325
  }
323
- function K({ corporateId: e, variant: a, labels: t, children: r }) {
324
- return /* @__PURE__ */ n(x, { labels: t, children: /* @__PURE__ */ n(w, { corporateId: e, variant: a, children: r }) });
326
+ function W({ corporateId: e, variant: a, labels: t, children: r }) {
327
+ return /* @__PURE__ */ n(L, { labels: t, children: /* @__PURE__ */ n(N, { corporateId: e, variant: a, children: r }) });
325
328
  }
326
- const I = ["white", "g10", "g90", "g100"];
329
+ const U = ["white", "g10", "g90", "g100"];
327
330
  function q() {
328
331
  const { variant: e, setVariant: a, theme: t } = l();
329
332
  return /* @__PURE__ */ S("div", { style: { display: "inline-flex", gap: "0.5rem", alignItems: "center" }, children: [
@@ -333,30 +336,30 @@ function q() {
333
336
  {
334
337
  value: e,
335
338
  onChange: (r) => a(r.target.value),
336
- children: I.map((r) => /* @__PURE__ */ n("option", { value: r, children: r.toUpperCase() }, r))
339
+ children: U.map((r) => /* @__PURE__ */ n("option", { value: r, children: r.toUpperCase() }, r))
337
340
  }
338
341
  )
339
342
  ] });
340
343
  }
341
- function U() {
344
+ function I() {
342
345
  const { theme: e } = l();
343
346
  return e.tokens;
344
347
  }
345
348
  function O() {
346
- return U().brandColors;
349
+ return I().brandColors;
347
350
  }
348
- function W() {
351
+ function J() {
349
352
  const { variant: e, setVariant: a } = l();
350
353
  return { variant: e, setVariant: a };
351
354
  }
352
- function J() {
355
+ function Q() {
353
356
  const { theme: e } = l();
354
357
  return {
355
358
  logo: e.tokens.logoUrl,
356
359
  brandColors: e.tokens.brandColors
357
360
  };
358
361
  }
359
- function Q() {
362
+ function X() {
360
363
  const { theme: e } = l();
361
364
  return e.tokens.density === "normal" ? "normal" : "compact";
362
365
  }
@@ -375,10 +378,13 @@ const j = {
375
378
  columnGap: "16px",
376
379
  readonlyBackground: "#f4f4f4",
377
380
  readonlyCursor: "default"
378
- }, c = {
381
+ }, i = {
379
382
  scope: "ui7-form-contract",
380
383
  densityCompact: "ui7-form-contract--density-compact",
381
384
  densityComfortable: "ui7-form-contract--density-comfortable",
385
+ widthHalf: "ui7-form-contract--width-half",
386
+ widthTwoThirds: "ui7-form-contract--width-two-thirds",
387
+ widthFull: "ui7-form-contract--width-full",
382
388
  readonly: "ui7-form-contract--readonly",
383
389
  row: "ui7-form-row",
384
390
  section: "ui7-form-section",
@@ -390,41 +396,52 @@ const j = {
390
396
  helper: "ui7-form-helper",
391
397
  readonlyValue: "ui7-form-readonly-value"
392
398
  };
393
- function H(e, a = "compact") {
399
+ function P(e, a = "compact") {
394
400
  return e === "compact" ? "compact" : e === "comfortable" || e === "normal" ? "comfortable" : a;
395
401
  }
396
402
  function M(e, a = "compact") {
397
- return H(e, a) === "compact" ? c.densityCompact : c.densityComfortable;
403
+ return P(e, a) === "compact" ? i.densityCompact : i.densityComfortable;
398
404
  }
399
405
  function R(e) {
400
- const a = [c.scope];
401
- return (e == null ? void 0 : e.density) !== void 0 && a.push(M(e.density)), e != null && e.readonly && a.push(c.readonly), e != null && e.className && a.push(e.className), a.join(" ");
406
+ switch (e) {
407
+ case "half":
408
+ return i.widthHalf;
409
+ case "full":
410
+ return i.widthFull;
411
+ case "two-thirds":
412
+ default:
413
+ return i.widthTwoThirds;
414
+ }
402
415
  }
403
- function X() {
404
- const { theme: e } = l(), a = H(e.tokens.density ?? "compact"), t = a === "compact" ? c.densityCompact : c.densityComfortable;
416
+ function _(e) {
417
+ const a = [i.scope];
418
+ return (e == null ? void 0 : e.density) !== void 0 && a.push(M(e.density)), a.push(R(e == null ? void 0 : e.width)), e != null && e.readonly && a.push(i.readonly), e != null && e.className && a.push(e.className), a.join(" ");
419
+ }
420
+ function Y() {
421
+ const { theme: e } = l(), a = P(e.tokens.density ?? "compact"), t = a === "compact" ? i.densityCompact : i.densityComfortable;
405
422
  return {
406
423
  density: a,
407
424
  densityClassName: t,
408
- scopeClassName: R({ density: a }),
409
- classNames: c,
425
+ scopeClassName: _({ density: a }),
426
+ classNames: i,
410
427
  tokens: j
411
428
  };
412
429
  }
413
430
  export {
414
- z as CorporateTheme,
415
- K as GlobalCorporateTheme,
416
- x as LabelsProvider,
417
- N as ThemeContextProvider,
418
- w as ThemeProvider,
431
+ K as CorporateTheme,
432
+ W as GlobalCorporateTheme,
433
+ L as LabelsProvider,
434
+ x as ThemeContextProvider,
435
+ N as ThemeProvider,
419
436
  q as ThemeSwitcher,
420
- y as corporateThemes,
421
- b as defaultLabels,
437
+ f as corporateThemes,
438
+ C as defaultLabels,
422
439
  O as useBrandColors,
423
- J as useCorporateFeatures,
424
- Q as useDensity,
425
- X as useFormVisualContract,
426
- G as useLabels,
440
+ Q as useCorporateFeatures,
441
+ X as useDensity,
442
+ Y as useFormVisualContract,
443
+ z as useLabels,
427
444
  l as useTheme,
428
- U as useThemeTokens,
429
- W as useThemeVariant
445
+ I as useThemeTokens,
446
+ J as useThemeVariant
430
447
  };
package/dist/labels.d.ts CHANGED
@@ -26,9 +26,12 @@ export interface Ui7Labels {
26
26
  logout: string;
27
27
  searchMenuPlaceholder: string;
28
28
  searchMenuAriaLabel: string;
29
+ openSearchNavigationButtonAriaLabel: string;
29
30
  clearSearchAriaLabel: string;
30
31
  removeFavoriteAriaLabel: string;
31
32
  addFavoriteAriaLabel: string;
33
+ favoritesTitle: string;
34
+ appSwitcherButtonAriaLabel: string;
32
35
  profileButtonAriaLabel: string;
33
36
  notificationsButtonAriaLabel: string;
34
37
  notificationsUnreadSuffix: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isi-ui7/corporate-themes",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Corporate themes (BCA Syariah, BJB Syariah, Pos Indonesia, Ihsan Solusi Informatika) with Carbon variants.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "react-dom": "^18 || ^19"
34
34
  },
35
35
  "dependencies": {
36
- "@isi-ui7/bos7-shared": "0.2.0"
36
+ "@isi-ui7/bos7-shared": "0.2.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "react": "^19.0.0",
@@ -46,10 +46,10 @@
46
46
  "typescript": "^5.3.3",
47
47
  "vite": "^5.0.0",
48
48
  "vite-plugin-dts": "^3.6.0",
49
- "@isi-ui7/editable-table": "0.2.1",
50
- "@isi-ui7/data-table": "0.2.1",
51
- "@isi-ui7/ui-shell": "0.2.2",
52
- "@isi-ui7/modal-manager": "0.2.1"
49
+ "@isi-ui7/ui-shell": "0.2.4",
50
+ "@isi-ui7/data-table": "0.2.2",
51
+ "@isi-ui7/modal-manager": "0.2.1",
52
+ "@isi-ui7/editable-table": "0.2.2"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vite build && node scripts/build-css.mjs",