@codeandfunction/callaloo 1.3.3 → 1.3.5

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.
@@ -1318,97 +1318,54 @@
1318
1318
  });
1319
1319
 
1320
1320
  const prefix$g = "clll-heading";
1321
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
1322
- ...{
1323
- inheritAttrs: false
1324
- },
1325
- __name: "Heading",
1321
+ const _sfc_main$l = {
1326
1322
  props: {
1327
- type: { default: HeadingTypes.Title },
1328
- theme: { default: Themes.Dark },
1329
- align: { default: Align.Left },
1330
- level: {}
1323
+ type: {
1324
+ type: String,
1325
+ default: HeadingTypes.Title
1326
+ },
1327
+ theme: {
1328
+ type: String,
1329
+ default: Themes.Dark
1330
+ },
1331
+ align: {
1332
+ type: String,
1333
+ default: Align.Left
1334
+ },
1335
+ level: {
1336
+ type: String
1337
+ }
1331
1338
  },
1332
- setup(__props) {
1333
- const props = __props;
1334
- const getClass = () => {
1335
- return [
1336
- prefix$g,
1337
- `${prefix$g}--${props.type}`,
1338
- `${prefix$g}--${props.theme}`,
1339
- `${prefix$g}--${props.align}`
1340
- ];
1341
- };
1342
- return (_ctx, _cache) => {
1343
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1344
- !_ctx.level ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1345
- _ctx.type === vue.unref(HeadingTypes).PageTitle ? (vue.openBlock(), vue.createElementBlock("h1", {
1346
- key: 0,
1347
- class: vue.normalizeClass(getClass())
1348
- }, [
1349
- vue.renderSlot(_ctx.$slots, "default")
1350
- ], 2)) : vue.createCommentVNode("", true),
1351
- _ctx.type === vue.unref(HeadingTypes).Title ? (vue.openBlock(), vue.createElementBlock("h1", {
1352
- key: 1,
1353
- class: vue.normalizeClass(getClass())
1354
- }, [
1355
- vue.renderSlot(_ctx.$slots, "default")
1356
- ], 2)) : vue.createCommentVNode("", true),
1357
- _ctx.type === vue.unref(HeadingTypes).Section ? (vue.openBlock(), vue.createElementBlock("h2", {
1358
- key: 2,
1359
- class: vue.normalizeClass(getClass())
1360
- }, [
1361
- vue.renderSlot(_ctx.$slots, "default")
1362
- ], 2)) : vue.createCommentVNode("", true),
1363
- _ctx.type === vue.unref(HeadingTypes).SubSection ? (vue.openBlock(), vue.createElementBlock("h3", {
1364
- key: 3,
1365
- class: vue.normalizeClass(getClass())
1366
- }, [
1367
- vue.renderSlot(_ctx.$slots, "default")
1368
- ], 2)) : vue.createCommentVNode("", true)
1369
- ], 64)) : vue.createCommentVNode("", true),
1370
- _ctx.level ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
1371
- _ctx.level === vue.unref(HeadingLevels).H1 ? (vue.openBlock(), vue.createElementBlock("h1", {
1372
- key: 0,
1373
- class: vue.normalizeClass(getClass())
1374
- }, [
1375
- vue.renderSlot(_ctx.$slots, "default")
1376
- ], 2)) : vue.createCommentVNode("", true),
1377
- _ctx.level === vue.unref(HeadingLevels).H2 ? (vue.openBlock(), vue.createElementBlock("h2", {
1378
- key: 1,
1379
- class: vue.normalizeClass(getClass())
1380
- }, [
1381
- vue.renderSlot(_ctx.$slots, "default")
1382
- ], 2)) : vue.createCommentVNode("", true),
1383
- _ctx.level === vue.unref(HeadingLevels).H3 ? (vue.openBlock(), vue.createElementBlock("h3", {
1384
- key: 2,
1385
- class: vue.normalizeClass(getClass())
1386
- }, [
1387
- vue.renderSlot(_ctx.$slots, "default")
1388
- ], 2)) : vue.createCommentVNode("", true),
1389
- _ctx.level === vue.unref(HeadingLevels).H4 ? (vue.openBlock(), vue.createElementBlock("h4", {
1390
- key: 3,
1391
- class: vue.normalizeClass(getClass())
1392
- }, [
1393
- vue.renderSlot(_ctx.$slots, "default")
1394
- ], 2)) : vue.createCommentVNode("", true),
1395
- _ctx.level === vue.unref(HeadingLevels).H5 ? (vue.openBlock(), vue.createElementBlock("h5", {
1396
- key: 4,
1397
- class: vue.normalizeClass(getClass())
1398
- }, [
1399
- vue.renderSlot(_ctx.$slots, "default")
1400
- ], 2)) : vue.createCommentVNode("", true),
1401
- _ctx.level === vue.unref(HeadingLevels).H6 ? (vue.openBlock(), vue.createElementBlock("h6", {
1402
- key: 5,
1403
- class: vue.normalizeClass(getClass())
1404
- }, [
1405
- vue.renderSlot(_ctx.$slots, "default")
1406
- ], 2)) : vue.createCommentVNode("", true)
1407
- ], 64)) : vue.createCommentVNode("", true)
1408
- ], 64);
1339
+ setup(props, { slots }) {
1340
+ const getLevel = () => {
1341
+ if (props.level) return props.level;
1342
+ switch (props.type) {
1343
+ case HeadingTypes.Section:
1344
+ return HeadingLevels.H2;
1345
+ case HeadingTypes.SubSection:
1346
+ return HeadingLevels.H3;
1347
+ case HeadingTypes.PageTitle:
1348
+ case HeadingTypes.Title:
1349
+ default:
1350
+ return HeadingLevels.H1;
1351
+ }
1409
1352
  };
1353
+ return () => vue.h(
1354
+ getLevel(),
1355
+ {
1356
+ class: [
1357
+ prefix$g,
1358
+ `${prefix$g}--${props.type}`,
1359
+ `${prefix$g}--${props.theme}`,
1360
+ `${prefix$g}--${props.align}`
1361
+ ]
1362
+ },
1363
+ {
1364
+ default: () => slots?.["default"] && slots?.["default"]()
1365
+ }
1366
+ );
1410
1367
  }
1411
- });
1368
+ };
1412
1369
 
1413
1370
  const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1414
1371
  const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
@@ -4394,35 +4351,47 @@
4394
4351
  });
4395
4352
 
4396
4353
  const prefix$1 = "clll-text";
4397
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
4398
- __name: "Text",
4354
+ const _sfc_main$2 = {
4399
4355
  props: {
4400
- type: { default: TextTypes.Body },
4401
- theme: { default: Themes.Dark },
4402
- truncate: { type: Boolean, default: false },
4403
- label: { type: Boolean, default: false },
4404
- as: { default: "p" }
4356
+ type: {
4357
+ type: String,
4358
+ default: TextTypes.Body
4359
+ },
4360
+ theme: {
4361
+ type: String,
4362
+ default: Themes.Dark
4363
+ },
4364
+ truncate: {
4365
+ type: Boolean,
4366
+ default: false
4367
+ },
4368
+ label: {
4369
+ type: Boolean,
4370
+ default: false
4371
+ },
4372
+ as: {
4373
+ type: String,
4374
+ default: "p"
4375
+ }
4405
4376
  },
4406
- setup(__props) {
4407
- return (_ctx, _cache) => {
4408
- const _component_as = vue.resolveComponent("as");
4409
- return vue.openBlock(), vue.createBlock(_component_as, {
4410
- class: vue.normalizeClass([
4377
+ setup(props, { slots }) {
4378
+ return () => vue.h(
4379
+ props.as,
4380
+ {
4381
+ class: [
4411
4382
  prefix$1,
4412
- `${prefix$1}--${_ctx.type}`,
4413
- `${prefix$1}--${_ctx.theme}`,
4414
- `${prefix$1}--${_ctx.truncate ? "wrap" : "nowrap"}`,
4415
- _ctx.label ? `${prefix$1}--label` : ""
4416
- ])
4417
- }, {
4418
- default: vue.withCtx(() => [
4419
- vue.renderSlot(_ctx.$slots, "default")
4420
- ]),
4421
- _: 3
4422
- }, 8, ["class"]);
4423
- };
4383
+ `${prefix$1}--${props.type}`,
4384
+ `${prefix$1}--${props.theme}`,
4385
+ `${prefix$1}--${props.truncate ? "wrap" : "nowrap"}`,
4386
+ props.label ? `${prefix$1}--label` : ""
4387
+ ]
4388
+ },
4389
+ {
4390
+ default: () => slots?.["default"] && slots?.["default"]()
4391
+ }
4392
+ );
4424
4393
  }
4425
- });
4394
+ };
4426
4395
 
4427
4396
  const _hoisted_1 = ["for"];
4428
4397
  const _hoisted_2 = ["id", "name", "aria-label", "autocomplete", "disabled", "form", "maxlength", "minlength", "pattern", "placeholder", "readonly", "required", "spellcheck", "rows", "value"];
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "Anthony Cholmondeley",
6
6
  "url": "https://callaloo.codeandfunction.com"
7
7
  },
8
- "version": "1.3.3",
8
+ "version": "1.3.5",
9
9
  "license": "MIT",
10
10
  "type": "module",
11
11
  "scripts": {