UNPKG

@progress/kendo-react-common

Version:

React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package

107 lines (106 loc) 3.29 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { base as i, labels as o, states as r, themeColorMap as x, directionMap as a } from "./json-classes.mjs"; const u = `${i.prefix}-${o.label}`, m = `${i.prefix}-${o.floatingLabel}`, y = `${i.prefix}-${o.error}`, b = `${i.prefix}-${o.hint}`, p = { label: { main: u, empty: `${i.prefix}-${o.label}-${r.empty}`, invalid: `${i.prefix}-${o.text}-${x.error}`, disabled: `${i.prefix}-${o.text}-${r.disabled}` } }, L = { label: ($) => { const { empty: d, invalid: c, disabled: s, c: e = p } = $, n = e.label; return { [n == null ? void 0 : n.main]: !0, [n == null ? void 0 : n.empty]: d, [n == null ? void 0 : n.invalid]: c, [n == null ? void 0 : n.disabled]: s }; } }, f = { wrapper: { main: `${m}-${o.container}`, focused: `${i.prefix}-${r.focus}`, empty: `${i.prefix}-${r.empty}`, notEmpty: "", disabled: `${i.prefix}-${o.text}-${r.disabled}`, isRtl: `${i.prefix}-${i.rtl}` }, label: { main: m, focused: "", empty: "", notEmpty: "", invalid: `${i.prefix}-${o.text}-${x.error}`, disabled: `${i.prefix}-${o.text}-${r.disabled}` } }, g = { wrapper: ($) => { const { focused: d, empty: c, notEmpty: s, disabled: e, isRtl: n, c: l = f } = $, t = l.wrapper; return { [t == null ? void 0 : t.main]: !0, [t == null ? void 0 : t.focused]: d, [t == null ? void 0 : t.empty]: c, [t == null ? void 0 : t.notEmpty]: s, [t == null ? void 0 : t.disabled]: e, [t == null ? void 0 : t.isRtl]: n }; }, label: ($) => { const { focused: d, empty: c, notEmpty: s, invalid: e, disabled: n, c: l = f } = $, t = l.label; return { [t == null ? void 0 : t.main]: !0, [t == null ? void 0 : t.focused]: d, [t == null ? void 0 : t.empty]: c, [t == null ? void 0 : t.notEmpty]: s, [t == null ? void 0 : t.invalid]: e, [t == null ? void 0 : t.disabled]: n }; } }, C = { wrapper: { main: y, direction: { start: `${i.prefix}-${o.text}-${a.start}`, end: `${i.prefix}-${o.text}-${a.end}` } } }, h = { wrapper: ($) => { const { direction: d, c = C } = $, s = c.wrapper; return { [s == null ? void 0 : s.main]: !0, [s == null ? void 0 : s.direction[d]]: s == null ? void 0 : s.direction[d] }; } }, E = { wrapper: { main: b, direction: { start: `${i.prefix}-${o.text}-${a.start}`, end: `${i.prefix}-${o.text}-${a.end}`, disabled: `${i.prefix}-${o.text}-${r.disabled}` } } }, R = { wrapper: ($) => { const { direction: d, disabled: c, c: s = E } = $, e = s.wrapper; return { [e == null ? void 0 : e.main]: !0, [e == null ? void 0 : e.direction[d]]: e == null ? void 0 : e.direction[d], [e == null ? void 0 : e.disabled]: c }; } }; export { h as uError, g as uFloatingLabel, R as uHint, L as uLabel };