UNPKG

mongodb-chatbot-ui

Version:

UI React components for the MongoDB Chatbot Framework

249 lines (228 loc) 7.15 kB
import x from "react"; import { b as tn } from "./index9.js"; import { m as i, b as E, F as r, k as p, v as s, T as z, ab as on, ah as an, d as cn, $ as ln, n as sn } from "./index2.js"; import { Q as un } from "./index10.js"; function t(n, e, o) { return (e = function(a) { var u = function(f, m) { if (typeof f != "object" || !f) return f; var b = f[Symbol.toPrimitive]; if (b !== void 0) { var h = b.call(f, m); if (typeof h != "object") return h; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(f); }(a, "string"); return typeof u == "symbol" ? u : u + ""; }(e)) in n ? Object.defineProperty(n, e, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = o, n; } function I(n, e) { var o = Object.keys(n); if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(n); e && (a = a.filter(function(u) { return Object.getOwnPropertyDescriptor(n, u).enumerable; })), o.push.apply(o, a); } return o; } function C(n) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e] != null ? arguments[e] : {}; e % 2 ? I(Object(o), !0).forEach(function(a) { t(n, a, o[a]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(o)) : I(Object(o)).forEach(function(a) { Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(o, a)); }); } return n; } function c(n, e) { return e || (e = n.slice(0)), Object.freeze(Object.defineProperties(n, { raw: { value: Object.freeze(e) } })); } var N, T, B, F, M, X, Q, _, q, A, G, H, U, J, P = { Default: "default", Large: "large", XLarge: "xlarge" }, fn = i(N || (N = c([` border: none; -webkit-appearance: unset; padding: unset; `]))), bn = i(T || (T = c([` display: inline-block; border-radius: 100px; position: relative; cursor: pointer; flex-shrink: 0; transition: `, `ms ease-in-out; transition-property: color, box-shadow; // Set background to fully-transparent white for cross-browser compatability with Safari // // Safari treats "transparent" values in CSS as transparent black instead of white // which can make things render differently across browsers if not defined explicitly. background-color: rgba(255, 255, 255, 0); &:before { content: ''; transition: `, `ms all ease-in-out; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: 100%; transform: scale(0.8); } &:active:before, &:hover:before, &:focus:before, &[data-hover='true']:before, &[data-focus='true']:before { transform: scale(1); } &:focus { outline: none; } `])), E.default, E.default), dn = t(t(t({}, P.Default, i(B || (B = c([` height: 28px; width: 28px; `])))), P.Large, i(F || (F = c([` height: 36px; width: 36px; `])))), P.XLarge, i(M || (M = c([` height: 42px; width: 42px; `])))), gn = t(t({}, s.Light, i(X || (X = c([` color: `, `; &:active, &:hover, &[data-hover='true'] { color: `, `; &:before { background-color: `, `; } } `])), r.gray.dark1, r.black, p(0.9, r.gray.dark2))), s.Dark, i(Q || (Q = c([` color: `, `; &:active, &:hover, &[data-hover='true'] { color: `, `; &:before { background-color: `, `; } } `])), r.gray.light1, r.gray.light3, p(0.9, r.gray.light2))), pn = t(t({}, s.Light, i(_ || (_ = c([` &:focus-visible, &[data-focus='true'] { color: `, `; box-shadow: `, `; &:before { background-color: `, `; } } `])), r.black, z[s.Light].default, p(0.9, r.gray.dark2))), s.Dark, i(q || (q = c([` &:focus-visible, &[data-focus='true'] { color: `, `; box-shadow: `, `; &:before { background-color: `, `; } } `])), r.gray.light3, z[s.Dark].default, p(0.9, r.gray.light2))), hn = t(t({}, s.Light, i(A || (A = c([` cursor: not-allowed; color: `, `; background-color: rgba(255, 255, 255, 0); &:active, &:hover, &[data-hover='true'] { color: `, `; &:before { background-color: rgba(255, 255, 255, 0); } } &:focus, &[data-focus='true'] { color: `, `; &:before { background-color: rgba(255, 255, 255, 0); } } `])), r.gray.light1, r.gray.light1, r.gray.light1)), s.Dark, i(G || (G = c([` cursor: not-allowed; color: `, `; background-color: rgba(255, 255, 255, 0); &:active, &:hover, &[data-hover='true'] { color: `, `; &:before { background-color: rgba(255, 255, 255, 0); } } &:focus, &[data-focus='true'] { color: `, `; &:before { background-color: rgba(255, 255, 255, 0); } } `])), r.gray.dark1, r.gray.dark1, r.gray.dark1)), vn = t(t({}, s.Light, i(H || (H = c([` color: `, `; &:before { background-color: `, `; transform: scale(1); } `])), r.black, p(0.9, r.gray.dark2))), s.Dark, i(U || (U = c([` color: `, `; &:before { background-color: `, `; transform: scale(1); } `])), r.gray.light3, p(0.9, r.gray.light2))), yn = i(J || (J = c([` position: absolute; top: 0; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; `]))), mn = ["as", "size", "darkMode", "disabled", "active", "tabIndex", "className", "children"], kn = on(function(n, e) { var o = n.as, a = n.size, u = a === void 0 ? P.Default : a, f = n.darkMode, m = n.disabled, b = m !== void 0 && m, h = n.active, K = h !== void 0 && h, D = n.tabIndex, R = D === void 0 ? 0 : D, V = n.className, W = n.children, Y = function(l, v) { if (l == null) return {}; var d, g, y = function(O, en) { if (O == null) return {}; var $ = {}; for (var j in O) if ({}.hasOwnProperty.call(O, j)) { if (en.indexOf(j) !== -1) continue; $[j] = O[j]; } return $; }(l, v); if (Object.getOwnPropertySymbols) { var L = Object.getOwnPropertySymbols(l); for (g = 0; g < L.length; g++) d = L[g], v.indexOf(d) === -1 && {}.propertyIsEnumerable.call(l, d) && (y[d] = l[d]); } return y; }(n, mn), S = an(o, Y, "button"), Z = S.Component, k = S.rest, w = cn(f).theme; tn(k, "IconButton"); var nn = x.Children.map(W, function(l) { if (!l) return null; if (ln(l, "Icon") || un(l)) { var v = l.props, d = v.size, g = v.title, y = { size: d || u }; return typeof g == "string" && g.length !== 0 || (y.title = !1), x.cloneElement(l, y); } return l; }), rn = C(C({}, k), {}, t(t(t(t({ ref: e, tabIndex: R }, "aria-disabled", b), "href", b ? void 0 : k.href), "onClick", b ? void 0 : k.onClick), "className", sn(fn, bn, dn[u], gn[w], pn[w], t(t({}, vn[w], K && !b), hn[w], b), V))); return x.createElement(Z, rn, x.createElement("div", { className: yn }, nn)); }); kn.displayName = "IconButton"; export { kn as H };