shadcn-svelte 0.3.3 → 0.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.
package/dist/index.js CHANGED
@@ -4861,6 +4861,9 @@ var logger = {
4861
4861
  },
4862
4862
  success(...args) {
4863
4863
  console.log(chalk.green(...args));
4864
+ },
4865
+ highlight(...args) {
4866
+ return chalk.cyan(...args);
4864
4867
  }
4865
4868
  };
4866
4869
 
@@ -6084,6 +6087,7 @@ function transformImport(content, config) {
6084
6087
  var addOptionsSchema = z3.object({
6085
6088
  components: z3.array(z3.string()).optional(),
6086
6089
  yes: z3.boolean(),
6090
+ all: z3.boolean(),
6087
6091
  overwrite: z3.boolean(),
6088
6092
  cwd: z3.string(),
6089
6093
  path: z3.string().optional(),
@@ -6093,11 +6097,12 @@ var add = new Command().command("add").description("add components to your proje
6093
6097
  "--nodep",
6094
6098
  "disable adding & installing dependencies (advanced)",
6095
6099
  false
6096
- ).option("-y, --yes", "Skip confirmation prompt.", false).option("-o, --overwrite", "overwrite existing files.", false).option(
6100
+ ).option("-a, --all", "Add all components to your project.", false).option("-y, --yes", "Skip confirmation prompt.", false).option("-o, --overwrite", "overwrite existing files.", false).option(
6097
6101
  "-c, --cwd <cwd>",
6098
6102
  "the working directory. defaults to the current directory.",
6099
6103
  process.cwd()
6100
6104
  ).option("-p, --path <path>", "the path to add the component to.").action(async (components, opts) => {
6105
+ const highlight = logger.highlight;
6101
6106
  logger.warn(
6102
6107
  "Running the following command will overwrite existing files."
6103
6108
  );
@@ -6129,17 +6134,17 @@ var add = new Command().command("add").description("add components to your proje
6129
6134
  return;
6130
6135
  }
6131
6136
  const registryIndex = await getRegistryIndex();
6132
- let selectedComponents = options.components;
6133
- if (!options.components?.length) {
6137
+ let selectedComponents = options.all ? registryIndex.map(({ name }) => name) : options.components;
6138
+ if (!selectedComponents?.length) {
6134
6139
  const { components: components2 } = await prompts2({
6135
6140
  type: "multiselect",
6136
6141
  name: "components",
6137
6142
  message: "Which components would you like to add?",
6138
6143
  hint: "Space to select. A to toggle all. Enter to submit.",
6139
6144
  instructions: false,
6140
- choices: registryIndex.map((entry) => ({
6141
- title: entry.name,
6142
- value: entry.name
6145
+ choices: registryIndex.map(({ name }) => ({
6146
+ title: name,
6147
+ value: name
6143
6148
  }))
6144
6149
  });
6145
6150
  selectedComponents = components2;
@@ -6159,6 +6164,8 @@ var add = new Command().command("add").description("add components to your proje
6159
6164
  process.exitCode = 0;
6160
6165
  return;
6161
6166
  }
6167
+ logger.info(`Selected components:
6168
+ ${highlight(selectedComponents)}`);
6162
6169
  if (!options.yes) {
6163
6170
  const { proceed } = await prompts2({
6164
6171
  type: "confirm",
@@ -6330,6 +6337,7 @@ var TAILWIND_CONFIG_WITH_VARIABLES = `import { fontFamily } from "tailwindcss/de
6330
6337
  const config = {
6331
6338
  darkMode: ["class"],
6332
6339
  content: ["./src/**/*.{html,js,svelte,ts}"],
6340
+ safelist: ["dark"],
6333
6341
  theme: {
6334
6342
  container: {
6335
6343
  center: true,
@@ -6451,7 +6459,7 @@ var init2 = new Command2().command("init").description("Configure your SvelteKit
6451
6459
  }
6452
6460
  });
6453
6461
  async function promptForConfig(cwd, defaultConfig = null, skip = false) {
6454
- const highlight = (text2) => chalk3.cyan(text2);
6462
+ const highlight = logger.highlight;
6455
6463
  const styles2 = await getRegistryStyles();
6456
6464
  const baseColors = await getRegistryBaseColors();
6457
6465
  const options = await prompts3([